File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -588,7 +588,11 @@ endfunction
588588function ! jedi#smart_auto_mappings (... ) abort
589589 " Auto put import statement after from module.name<space> and complete.
590590 if a: 0
591+ " Callback from timer.
592+ let pos = getpos (' .' )
591593 if b: changedtick == s: import_timer [1 ] + 1
594+ \ && mode () == # ' i'
595+ \ && s: import_timer [2 ][1 :2 ] == [pos[1 ], pos[2 ]-1 ]
592596 " Enter characters and start completion.
593597 call feedkeys (" import \<C-x>\<C-o>\<C-r> =jedi#complete_opened(1)\<CR> " , ' nt' )
594598 endif
@@ -601,7 +605,7 @@ function! jedi#smart_auto_mappings(...) abort
601605 endif
602606 let s: import_timer = [
603607 \ timer_start (g: jedi #smart_auto_mappings_delay, function (' jedi#smart_auto_mappings' )),
604- \ b: changedtick ]
608+ \ b: changedtick, getpos ( ' . ' ) ]
605609 else
606610 " Enter characters and start completion.
607611 return " \<space> import \<C-x>\<C-o>\<C-r> =jedi#complete_opened(1)\<CR> "
You can’t perform that action at this time.
0 commit comments