From a62d68756bdcacc5374b42e1913de669c9d79548 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 28 Jul 2018 06:24:09 +0200 Subject: [PATCH] complete-on-dot: do not trigger with dot in front Fixes https://github.com/davidhalter/jedi-vim/issues/506 --- ftplugin/python/jedi.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ftplugin/python/jedi.vim b/ftplugin/python/jedi.vim index 5525f1bc..915f79c6 100644 --- a/ftplugin/python/jedi.vim +++ b/ftplugin/python/jedi.vim @@ -34,7 +34,14 @@ if g:jedi#auto_initialization endif if g:jedi#completions_enabled == 1 - inoremap . .=jedi#complete_string(1) + function! s:complete_on_dot() abort + " Do not trigger completion if there is a dot before already. + if getline('.')[-2:-2] ==# '.' + return '' + endif + return jedi#complete_string(1) + endfunction + inoremap . .=complete_on_dot() endif if g:jedi#smart_auto_mappings == 1