mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 03:24:47 +08:00
change some more complete_string details
This commit is contained in:
@@ -147,19 +147,6 @@ endfunc
|
|||||||
|
|
||||||
|
|
||||||
function! jedi#popup_on_dot_string()
|
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
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
@@ -187,18 +174,22 @@ function! jedi#_vim_exceptions(str, is_eval)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! jedi#auto_complete_string()
|
function! jedi#complete_string(is_popup_on_dot)
|
||||||
if pumvisible()
|
|
||||||
if g:jedi#popup_select_first
|
if a:is_popup_on_dot && !(g:jedi#popup_on_dot && jedi#do_popup_on_dot_in_highlight())
|
||||||
return "\<C-n>"
|
return ''
|
||||||
|
|
||||||
end
|
end
|
||||||
|
if pumvisible() && !a:is_popup_on_dot
|
||||||
|
return "\<C-n>"
|
||||||
else
|
else
|
||||||
return "\<C-x>\<C-o>\<C-r>=jedi#auto_complete_opened()\<CR>"
|
return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened()\<CR>"
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! jedi#auto_complete_opened()
|
function! jedi#complete_opened()
|
||||||
if pumvisible()
|
if pumvisible() && g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1
|
||||||
|
" only go down if it is visible, user-enabled and the longest option is set
|
||||||
return "\<Down>"
|
return "\<Down>"
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ if g:jedi#auto_initialization
|
|||||||
" map ctrl+space for autocompletion
|
" map ctrl+space for autocompletion
|
||||||
if g:jedi#completions_command == "<C-Space>"
|
if g:jedi#completions_command == "<C-Space>"
|
||||||
" in terminals, <C-Space> sometimes equals <Nul>
|
" in terminals, <C-Space> sometimes equals <Nul>
|
||||||
inoremap <expr> <Nul> jedi#auto_complete_string()
|
inoremap <expr> <Nul> jedi#complete_string(0)
|
||||||
endif
|
endif
|
||||||
if g:jedi#completions_command != ""
|
if g:jedi#completions_command != ""
|
||||||
execute "inoremap <expr> <buffer> ".g:jedi#completions_command." jedi#auto_complete_string()"
|
execute "inoremap <expr> <buffer> ".g:jedi#completions_command." jedi#complete_string(0)"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ if g:jedi#auto_initialization
|
|||||||
call jedi#configure_call_signatures()
|
call jedi#configure_call_signatures()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
inoremap <silent> <buffer> . .<C-R>=jedi#popup_on_dot_string()<CR>
|
inoremap <silent> <buffer> . .<C-R>=jedi#complete_string(1)<CR>
|
||||||
|
|
||||||
if g:jedi#auto_close_doc
|
if g:jedi#auto_close_doc
|
||||||
" close preview if its still open after insert
|
" close preview if its still open after insert
|
||||||
|
|||||||
Reference in New Issue
Block a user