Further fixes to doc macro dispatching
This commit is contained in:
parent
0db6f6fb51
commit
742f23e0b9
@ -834,10 +834,10 @@ function! foreplay#ns() abort
|
|||||||
return s:tons(path ==# '' ? 'user' : path)
|
return s:tons(path ==# '' ? 'user' : path)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:Lookup(macro, arg) abort
|
function! s:Lookup(ns, macro, arg) abort
|
||||||
" doc is in clojure.core in older Clojure versions
|
" doc is in clojure.core in older Clojure versions
|
||||||
try
|
try
|
||||||
call foreplay#eval("(eval (list (if (ns-resolve 'clojure.core '".a:macro.") '".a:macro." 'clojure.repl/".a:macro.") '".a:arg.'))')
|
call foreplay#eval("(require '".a:ns.") (eval (list (if (ns-resolve 'clojure.core '".a:macro.") 'clojure.core/".a:macro." '".a:ns.'/'.a:macro.") '".a:arg.'))')
|
||||||
catch /^Clojure:/
|
catch /^Clojure:/
|
||||||
catch /.*/
|
catch /.*/
|
||||||
echohl ErrorMSG
|
echohl ErrorMSG
|
||||||
@ -896,10 +896,10 @@ augroup foreplay_doc
|
|||||||
autocmd FileType clojure nnoremap <buffer> [d :Source <C-R><C-W><CR>
|
autocmd FileType clojure nnoremap <buffer> [d :Source <C-R><C-W><CR>
|
||||||
autocmd FileType clojure nnoremap <buffer> ]d :Source <C-R><C-W><CR>
|
autocmd FileType clojure nnoremap <buffer> ]d :Source <C-R><C-W><CR>
|
||||||
autocmd FileType clojure command! -buffer -nargs=1 Apropos :exe s:Apropos(<q-args>)
|
autocmd FileType clojure command! -buffer -nargs=1 Apropos :exe s:Apropos(<q-args>)
|
||||||
autocmd FileType clojure command! -buffer -nargs=1 FindDoc :exe s:Lookup('find-doc', printf('#"%s"', <q-args>))
|
autocmd FileType clojure command! -buffer -nargs=1 FindDoc :exe s:Lookup('clojure.repl', 'find-doc', printf('#"%s"', <q-args>))
|
||||||
autocmd FileType clojure command! -buffer -bar -nargs=1 Javadoc :exe s:Lookup('clojure.java.javadoc/javadoc', <q-args>)
|
autocmd FileType clojure command! -buffer -bar -nargs=1 Javadoc :exe s:Lookup('clojure.java.javadoc', 'javadoc', <q-args>)
|
||||||
autocmd FileType clojure command! -buffer -bar -nargs=1 -complete=customlist,foreplay#eval_complete Doc :exe s:Lookup('doc', <q-args>)
|
autocmd FileType clojure command! -buffer -bar -nargs=1 -complete=customlist,foreplay#eval_complete Doc :exe s:Lookup('clojure.repl', 'doc', <q-args>)
|
||||||
autocmd FileType clojure command! -buffer -bar -nargs=1 -complete=customlist,foreplay#eval_complete Source :exe s:Lookup('source', <q-args>)
|
autocmd FileType clojure command! -buffer -bar -nargs=1 -complete=customlist,foreplay#eval_complete Source :exe s:Lookup('clojure.repl', 'source', <q-args>)
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
|
Loading…
Reference in New Issue
Block a user