mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +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
|
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
|
" Auto put import statement after from module.name<space> and complete
|
||||||
if search('\<from\s\+[A-Za-z0-9._]\+\s*\%#\s*$', 'bcn', line('.'))
|
if search('\<from\s\+[A-Za-z0-9._]\+\s*\%#\s*$', 'bcn', line('.'))
|
||||||
" Enter character and start completion.
|
" 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
|
endif
|
||||||
return "\<space>"
|
return "\<space>"
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if g:jedi#auto_initialization
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if g:jedi#smart_auto_mappings == 1
|
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
|
end
|
||||||
|
|
||||||
if g:jedi#auto_close_doc
|
if g:jedi#auto_close_doc
|
||||||
|
|||||||
Reference in New Issue
Block a user