change some more complete_string details

This commit is contained in:
David Halter
2013-08-28 19:36:57 +04:30
parent 3934359666
commit dd426c6369
2 changed files with 15 additions and 24 deletions

View File

@@ -147,19 +147,6 @@ 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
@@ -187,18 +174,22 @@ function! jedi#_vim_exceptions(str, is_eval)
endfunction
function! jedi#auto_complete_string()
if pumvisible()
if g:jedi#popup_select_first
return "\<C-n>"
end
function! jedi#complete_string(is_popup_on_dot)
if a:is_popup_on_dot && !(g:jedi#popup_on_dot && jedi#do_popup_on_dot_in_highlight())
return ''
end
if pumvisible() && !a:is_popup_on_dot
return "\<C-n>"
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
endfunction
function! jedi#auto_complete_opened()
if pumvisible()
function! jedi#complete_opened()
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>"
end
return ""

View File

@@ -14,10 +14,10 @@ if g:jedi#auto_initialization
" map ctrl+space for autocompletion
if g:jedi#completions_command == "<C-Space>"
" in terminals, <C-Space> sometimes equals <Nul>
inoremap <expr> <Nul> jedi#auto_complete_string()
inoremap <expr> <Nul> jedi#complete_string(0)
endif
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
@@ -44,7 +44,7 @@ if g:jedi#auto_initialization
call jedi#configure_call_signatures()
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
" close preview if its still open after insert