summaryrefslogtreecommitdiff
path: root/plugin/fzf.vim
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-04-04 11:55:57 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-04-04 11:55:57 +0900
commit68503d32df91ded701cf7ad07f340aade4aa2e1d (patch)
tree92e72433e719f5852143be92f1856e5af0e76390 /plugin/fzf.vim
parent57319f8c58e23257058a2e698b1f8c612db68d8d (diff)
downloadfzf-68503d32df91ded701cf7ad07f340aade4aa2e1d.tar.gz
[vim] Code cleanup
Diffstat (limited to 'plugin/fzf.vim')
-rw-r--r--plugin/fzf.vim24
1 files changed, 9 insertions, 15 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 479fc7df..ac17a417 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -125,11 +125,15 @@ function! fzf#run(...) abort
let split = s:tmux_enabled() && s:tmux_splittable(dict)
let command = prefix.(split ? s:fzf_tmux(dict) : fzf_exec).' '.optstr.' > '.temps.result
- if split
- return s:execute_tmux(dict, command, temps)
- else
- return s:execute(dict, command, temps)
- endif
+ try
+ if split
+ return s:execute_tmux(dict, command, temps)
+ else
+ return s:execute(dict, command, temps)
+ endif
+ finally
+ call s:popd(dict)
+ endtry
endfunction
function! s:present(dict, ...)
@@ -195,14 +199,6 @@ function! s:execute(dict, command, temps)
endif
endfunction
-function! s:env_var(name)
- if exists('$'.a:name)
- return a:name . "='". substitute(expand('$'.a:name), "'", "'\\\\''", 'g') . "' "
- else
- return ''
- endif
-endfunction
-
function! s:execute_tmux(dict, command, temps)
let command = a:command
if s:pushd(a:dict)
@@ -234,8 +230,6 @@ function! s:callback(dict, temps)
silent! call delete(tf)
endfor
- call s:popd(a:dict)
-
return lines
endfunction