[vim] Ignore 'dir' option if empty

This makes it easier to override FZF command like follows:

    autocmd VimEnter * command! -nargs=? -bang -complete=dir FZF call fzf#run({
          \ 'sink': 'tabe',
          \ 'dir': <q-args>,
          \ 'options': '-m',
          \ 'tmux_height': empty('<bang>') ? '40%' : '' })
pull/106/head
Junegunn Choi 10 years ago
parent d1387bf512
commit 6fd6fff3a6

@ -113,7 +113,7 @@ function! s:tmux_splittable(dict)
endfunction
function! s:pushd(dict)
if has_key(a:dict, 'dir')
if !empty(get(a:dict, 'dir', ''))
let a:dict.prev_dir = getcwd()
execute 'chdir '.s:escape(a:dict.dir)
endif
@ -158,7 +158,7 @@ endfunction
function! s:execute_tmux(dict, command, temps)
let command = s:env_var('FZF_DEFAULT_OPTS').s:env_var('FZF_DEFAULT_COMMAND').a:command
if has_key(a:dict, 'dir')
if !empty(get(a:dict, 'dir', ''))
let command = 'cd '.s:escape(a:dict.dir).' && '.command
endif

Loading…
Cancel
Save