forked from VimPlug/jedi-vim
also move popup_on_dot_string method
This commit is contained in:
@@ -127,7 +127,7 @@ function! s:syn_stack()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
function! jedi#do_popup_on_dot()
|
function! jedi#do_popup_on_dot_in_highlight()
|
||||||
let highlight_groups = s:syn_stack()
|
let highlight_groups = s:syn_stack()
|
||||||
for a in highlight_groups
|
for a in highlight_groups
|
||||||
if a == 'pythonDoctest'
|
if a == 'pythonDoctest'
|
||||||
@@ -146,6 +146,23 @@ function! jedi#do_popup_on_dot()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
function! jedi#popup_on_dot_string()
|
||||||
|
if g:jedi#popup_on_dot && jedi#do_popup_on_dot_in_highlight()
|
||||||
|
if stridx(&completeopt, 'longest') > -1
|
||||||
|
if g:jedi#popup_select_first
|
||||||
|
return "\<C-X>\<C-O>\<Down>"
|
||||||
|
else
|
||||||
|
return "\<C-X>\<C-O>"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return "\<C-X>\<C-O>\<C-P>"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! jedi#configure_call_signatures()
|
function! jedi#configure_call_signatures()
|
||||||
autocmd InsertLeave <buffer> Python jedi_vim.clear_call_signatures()
|
autocmd InsertLeave <buffer> Python jedi_vim.clear_call_signatures()
|
||||||
autocmd CursorMovedI <buffer> call jedi#show_call_signatures_func()
|
autocmd CursorMovedI <buffer> call jedi#show_call_signatures_func()
|
||||||
@@ -172,7 +189,9 @@ endfunction
|
|||||||
|
|
||||||
function! jedi#auto_complete_string()
|
function! jedi#auto_complete_string()
|
||||||
if pumvisible()
|
if pumvisible()
|
||||||
return "\<C-n>"
|
if g:jedi#popup_select_first
|
||||||
|
return "\<C-n>"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
return "\<C-x>\<C-o>\<C-r>=jedi#auto_complete_opened()\<CR>"
|
return "\<C-x>\<C-o>\<C-r>=jedi#auto_complete_opened()\<CR>"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,6 +43,13 @@ if g:jedi#auto_initialization
|
|||||||
if g:jedi#show_call_signatures == 1 && has('conceal')
|
if g:jedi#show_call_signatures == 1 && has('conceal')
|
||||||
call jedi#configure_call_signatures()
|
call jedi#configure_call_signatures()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
inoremap <silent> <buffer> . .<C-R>=jedi#popup_on_dot_string()<CR>
|
||||||
|
|
||||||
|
if g:jedi#auto_close_doc
|
||||||
|
" close preview if its still open after insert
|
||||||
|
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if g:jedi#auto_vim_configuration
|
if g:jedi#auto_vim_configuration
|
||||||
@@ -51,21 +58,3 @@ if g:jedi#auto_vim_configuration
|
|||||||
inoremap <C-c> <ESC>
|
inoremap <C-c> <ESC>
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if g:jedi#popup_on_dot
|
|
||||||
if stridx(&completeopt, 'longest') > -1
|
|
||||||
if g:jedi#popup_select_first
|
|
||||||
inoremap <silent> <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>\<lt>Down>" : ""<CR>
|
|
||||||
else
|
|
||||||
inoremap <silent> <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>" : ""<CR>
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
|
||||||
inoremap <silent> <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>\<lt>C-P>" : ""<CR>
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if g:jedi#auto_close_doc
|
|
||||||
" close preview if its still open after insert
|
|
||||||
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
|
|
||||||
end
|
|
||||||
|
|||||||
Reference in New Issue
Block a user