diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2017-08-27 00:55:14 -0400 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-09-05 13:29:46 +0900 |
commit | 6c41c95f282861d1cd49827d4a1ca992944a861f (patch) | |
tree | 9eeacd6461794dae75b6a5b266b53d9b79e07de9 | |
parent | 446e04469df8ff3e49c18fe49722cac77e35d1a5 (diff) |
[vim] s:execute_term works in GVim on Windows
Requirements:
- compiled with +terminal
- has patch-8.0.995
- has('gui_running') returns 1
-rw-r--r-- | plugin/fzf.vim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 6b16b10e..e18b23c7 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -389,7 +389,7 @@ try let use_height = has_key(dict, 'down') && \ !(has('nvim') || s:is_win || has('win32unix') || s:present(dict, 'up', 'left', 'right')) && \ executable('tput') && filereadable('/dev/tty') - let use_term = has('nvim-0.2.1') || (has('nvim') && !s:is_win) + let use_term = has('nvim-0.2.1') || (has('nvim') && !s:is_win) || (has('terminal') && has('gui_running') && has('patch-8.0.995')) let use_tmux = (!use_height && !use_term || prefer_tmux) && !has('win32unix') && s:tmux_enabled() && s:splittable(dict) if prefer_tmux && use_tmux let use_height = 0 @@ -647,7 +647,7 @@ function! s:execute_term(dict, command, temps) abort endif endif endfunction - function! fzf.on_exit(id, code, _event) + function! fzf.on_exit(id, code, ...) if s:getpos() == self.ppos " {'window': 'enew'} for [opt, val] in items(self.winopts) execute 'let' opt '=' val @@ -692,7 +692,12 @@ function! s:execute_term(dict, command, temps) abort else let command = a:command endif - call termopen(command.s:term_marker, fzf) + let command .= s:term_marker + if has('nvim') + call termopen(command, fzf) + else + call term_start([&shell, &shellcmdflag, command], {'curwin': fzf.buf, 'exit_cb': function(fzf.on_exit)}) + endif finally if s:present(a:dict, 'dir') lcd - |