[vim] s:execute_term works in GVim on Windows

Requirements:
- compiled with +terminal
- has patch-8.0.995
- has('gui_running') returns 1
This commit is contained in:
Jan Edmund Lazo 2017-08-27 00:55:14 -04:00 committed by Junegunn Choi
parent 446e04469d
commit 6c41c95f28

View File

@ -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 -