forked from VimPlug/jedi-vim
Fix restoring alternate terminal with completeopt redirection
Fixes https://github.com/davidhalter/jedi-vim/issues/721.
This commit is contained in:
@@ -16,11 +16,28 @@ if get(g:, 'jedi#auto_vim_configuration', 1)
|
|||||||
filetype plugin on
|
filetype plugin on
|
||||||
|
|
||||||
" Change completeopt, but only if it was not set already.
|
" Change completeopt, but only if it was not set already.
|
||||||
redir => completeopt
|
" This gets done on VimEnter, since otherwise Vim fails to restore the
|
||||||
silent verb set completeopt?
|
" screen. Neovim is not affected, this is likely caused by using
|
||||||
redir END
|
" :redir/execute() before the (alternate) terminal is configured.
|
||||||
if len(split(completeopt, '\n')) == 1
|
function! s:setup_completeopt()
|
||||||
set completeopt=menuone,longest,preview
|
if exists('*execute')
|
||||||
|
let completeopt = execute('silent verb set completeopt?')
|
||||||
|
else
|
||||||
|
redir => completeopt
|
||||||
|
silent verb set completeopt?
|
||||||
|
redir END
|
||||||
|
endif
|
||||||
|
if len(split(completeopt, '\n')) == 1
|
||||||
|
set completeopt=menuone,longest,preview
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
if has('nvim')
|
||||||
|
call s:setup_completeopt()
|
||||||
|
else
|
||||||
|
augroup jedi_startup
|
||||||
|
au!
|
||||||
|
autocmd VimEnter * call s:setup_completeopt()
|
||||||
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if len(mapcheck('<C-c>', 'i')) == 0
|
if len(mapcheck('<C-c>', 'i')) == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user