summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-08-30 18:58:28 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-08-30 18:58:28 +0900
commit48adad5454c25a626b5f8398cce97701d63af640 (patch)
treeafc34179843dab3d43dd89527c8eef43defed54a /plugin
parentb27dc3eb1745ed29146feca94652bba0f0dd21c2 (diff)
[neovim] Set &shell to sh (again) after opening a new window
Close #1031
Diffstat (limited to 'plugin')
-rw-r--r--plugin/fzf.vim17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 0f4fc772..d3673b31 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -328,17 +328,20 @@ function! fzf#wrap(...)
return opts
endfunction
-function! fzf#run(...) abort
-try
- let oshell = &shell
- let useshellslash = &shellslash
-
+function! s:use_sh()
+ let [shell, shellslash] = [&shell, &shellslash]
if s:is_win
set shell=cmd.exe
set noshellslash
else
set shell=sh
endif
+ return [shell, shellslash]
+endfunction
+
+function! fzf#run(...) abort
+try
+ let [shell, shellslash] = s:use_sh()
let dict = exists('a:1') ? s:upgrade(a:1) : {}
let temps = { 'result': s:fzf_tempname() }
@@ -405,8 +408,7 @@ try
call s:callback(dict, lines)
return lines
finally
- let &shell = oshell
- let &shellslash = useshellslash
+ let [&shell, &shellslash] = [shell, shellslash]
endtry
endfunction
@@ -625,6 +627,7 @@ function! s:execute_term(dict, command, temps) abort
let winrest = winrestcmd()
let pbuf = bufnr('')
let [ppos, winopts] = s:split(a:dict)
+ call s:use_sh()
let b:fzf = a:dict
let fzf = { 'buf': bufnr(''), 'pbuf': pbuf, 'ppos': ppos, 'dict': a:dict, 'temps': a:temps,
\ 'winopts': winopts, 'winrest': winrest, 'lines': &lines,