summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-10-15 13:22:00 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-10-15 13:22:00 +0900
commit6fd6fff3a65ec23cfd84d347d77648fde2b24ee9 (patch)
tree4750ebbd9de65663916d5e97b733227d85ae6de1
parentd1387bf512c1ffee64140e07f95a82e78873ffc3 (diff)
[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%' : '' })
-rw-r--r--plugin/fzf.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 62194709..db3c649b 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -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