Skip to content
Myr

[vim] fzf#run should ignore empty 'dir' argument

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #2343

authored by Junegunn Choi · committed by Junegunn Choi · parent f55c990 · Browse files · 2 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−4 removed

  • other:+4 added−4 removed

2 files+4 added−4 removed

modified:plugin/fzf.vim+2 added-2 removed
422 unmodified lines
423 catch424 throw v:exception425 endtry426427 if !has_key(dict, 'dir')427 if !s:present(dict, 'dir')428 let dict.dir = s:fzf_getcwd()429 endif430 if has('win32unix') && has_key(dict, 'dir')430 if has('win32unix') && s:present(dict, 'dir')431 let dict.dir = fnamemodify(dict.dir, ':p')432 endif433434 if has_key(dict, 'source')
552 unmodified lines
modified:README-VIM.md+2 added-2 removed
360 unmodified lines
361Our `:LS` command will be much more useful if we can pass a directory argument362to it, so that something like `:LS /tmp` is possible.363364```vim365command! -bang -complete=dir -nargs=* LS365command! -bang -complete=dir -nargs=? LS366 \ call fzf#run(fzf#wrap({'source': 'ls', 'dir': <q-args>}, <bang>0))367```368369Lastly, if you have enabled `g:fzf_history_dir`, you might want to assign
1 unmodified line
371372```vim373" The query history for this command will be stored as 'ls' inside g:fzf_history_dir.374" The name is ignored if g:fzf_history_dir is not defined.375command! -bang -complete=dir -nargs=* LS375command! -bang -complete=dir -nargs=? LS376 \ call fzf#run(fzf#wrap('ls', {'source': 'ls', 'dir': <q-args>}, <bang>0))377```378379### Global options supported by `fzf#wrap`
73 unmodified lines