Skip to content

Commit

Permalink
complete-on-dot: do not trigger with dot in front
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jul 28, 2018
1 parent 4c430ed commit a62d687
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ftplugin/python/jedi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ if g:jedi#auto_initialization
endif

if g:jedi#completions_enabled == 1
inoremap <silent> <buffer> . .<C-R>=jedi#complete_string(1)<CR>
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 <silent> <buffer> . .<C-R>=<SID>complete_on_dot()<CR>
endif

if g:jedi#smart_auto_mappings == 1
Expand Down

0 comments on commit a62d687

Please sign in to comment.