forked from VimPlug/jedi-vim
Merge pull request #396 from blueyed/fix-dot-completion-dev
Fix popup-on-dot completion: use <C-p> to deselect the first entry
This commit is contained in:
@@ -240,15 +240,22 @@ function! jedi#complete_string(is_popup_on_dot)
|
|||||||
if pumvisible() && !a:is_popup_on_dot
|
if pumvisible() && !a:is_popup_on_dot
|
||||||
return "\<C-n>"
|
return "\<C-n>"
|
||||||
else
|
else
|
||||||
return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened()\<CR>"
|
return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened(".a:is_popup_on_dot.")\<CR>"
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! jedi#complete_opened()
|
function! jedi#complete_opened(is_popup_on_dot)
|
||||||
if pumvisible() && g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1
|
if pumvisible()
|
||||||
" only go down if it is visible, user-enabled and the longest option is set
|
if a:is_popup_on_dot
|
||||||
return "\<Down>"
|
" Prevent completion of the first entry with dot completion.
|
||||||
|
return "\<C-p>"
|
||||||
|
endif
|
||||||
|
" Only go down if it is visible, user-enabled and the longest
|
||||||
|
" option is set.
|
||||||
|
if g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1
|
||||||
|
return "\<Down>"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
return ""
|
return ""
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user