mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 18:54:44 +08:00
jedi#smart_auto_mappings: always 'popup_on_dot'
`popup_on_dot=1` means that it should not auto-select the first entry, which is the case for the new smart-import-mapping.
This commit is contained in:
@@ -423,11 +423,11 @@ function! jedi#complete_opened(is_popup_on_dot)
|
||||
endfunction
|
||||
|
||||
|
||||
function! jedi#smart_auto_mappings(is_popup_on_dot)
|
||||
function! jedi#smart_auto_mappings()
|
||||
" Auto put import statement after from module.name<space> and complete
|
||||
if search('\<from\s\+[A-Za-z0-9._]\+\s*\%#\s*$', 'bcn', line('.'))
|
||||
" Enter character and start completion.
|
||||
return "\<space>import \<C-x>\<C-o>\<C-r>=jedi#complete_opened(".a:is_popup_on_dot.")\<CR>"
|
||||
return "\<space>import \<C-x>\<C-o>\<C-r>=jedi#complete_opened(1)\<CR>"
|
||||
endif
|
||||
return "\<space>"
|
||||
endfunction
|
||||
|
||||
@@ -38,7 +38,7 @@ if g:jedi#auto_initialization
|
||||
endif
|
||||
|
||||
if g:jedi#smart_auto_mappings == 1
|
||||
inoremap <buffer> <expr> <Space> jedi#smart_auto_mappings(g:jedi#popup_on_dot)
|
||||
inoremap <buffer> <expr> <Space> jedi#smart_auto_mappings()
|
||||
end
|
||||
|
||||
if g:jedi#auto_close_doc
|
||||
|
||||
Reference in New Issue
Block a user