Skip to content

Commit

Permalink
squash! fixup! fixup! Import smart_auto_mappings: use a timer if avai…
Browse files Browse the repository at this point in the history
…lable

Only start completion with `g:jedi#completions_enabled`.
TODO: doc
  • Loading branch information
blueyed committed Jul 5, 2017
1 parent 585cd35 commit d3f91c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autoload/jedi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,10 @@ function! jedi#smart_auto_mappings(...) abort
\ && mode() ==# 'i'
\ && s:import_timer[2][1:2] == [pos[1], pos[2]-1]
" Enter characters and start completion.
call feedkeys("import \<C-x>\<C-o>\<C-r>=jedi#complete_opened(1)\<CR>", 'nt')
call feedkeys('import ', 'nt')
if g:jedi#completions_enabled
call feedkeys("\<C-x>\<C-o>\<C-r>=jedi#complete_opened(2)\<CR>", 'nt')
endif
endif
return
elseif search('\m^\s*from\s\+[A-Za-z0-9._]\{1,50}\%#\s*$', 'bcn', line('.'))
Expand Down

0 comments on commit d3f91c4

Please sign in to comment.