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:
Daniel Hahler
2015-08-18 10:28:27 +02:00
parent ac1615c647
commit 889feae117
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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