Skip to content

Commit

Permalink
Completion fixes
Browse files Browse the repository at this point in the history
Closes #202
  • Loading branch information
tpope committed May 28, 2017
1 parent 2013b5a commit d6927ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions autoload/dispatch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ endfunction

function! s:file_complete(A) abort
return map(split(glob(substitute(a:A, '.\@<=\ze[\\/]\|$', '*', 'g')), "\n"),
\ 'isdirectory(v:val) ? v:val . dispatch#slash() : v:val')
\ 'fnameescape(isdirectory(v:val) ? v:val . dispatch#slash() : v:val)')
endfunction

function! s:compiler_complete(compiler, A, L, P) abort
Expand Down Expand Up @@ -477,12 +477,13 @@ function! s:compiler_complete(compiler, A, L, P) abort
endfunction

function! dispatch#command_complete(A, L, P) abort
let args = matchstr(a:L, '\s\zs.*')
let L = strpart(a:L, 0, a:P)
let args = matchstr(L, '\s\zs.*')
let [cmd, opts] = s:extract_opts(args)
let P = a:P + len(cmd) - len(a:L)
let P = a:P + len(cmd) - len(L)
let len = matchend(cmd, '\S\+\s')
if len >= 0 && P >= 0
let args = matchstr(a:L, '\s\zs.*')
let args = matchstr(L, '\s\zs.*')
let compiler = get(opts, 'compiler', dispatch#compiler_for_program(cmd))
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
try
Expand Down

0 comments on commit d6927ff

Please sign in to comment.