File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed
autoload/vital/_easymotion/HitAHint Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -80,14 +80,24 @@ function! s:overwin.pattern(pattern) abort
8080 let winpos = self .select_winpos (self .gather_poses_overwin (a: pattern ), self .config.keys )
8181 if winpos is # -1
8282 else
83- let [winnr_str, pos] = winpos
84- let winnr = str2nr (winnr_str)
85- if winnr is # winnr ()
86- normal ! m `
87- else
88- call s: move_to_win (winnr )
89- endif
90- call cursor (pos)
83+ call s: move_to_winpos (winpos )
84+ endif
85+ endfunction
86+
87+ " @param {{winnr: [lnum, cnum]}}
88+ function ! s: move_to_winpos (winpos ) abort
89+ let [winnr_str, pos] = a: winpos
90+ let winnr = str2nr (winnr_str)
91+ let is_win_moved = ! (winnr is # winnr ())
92+ if is_win_moved
93+ doautocmd WinLeave *
94+ call s: move_to_win (winnr )
95+ else
96+ normal ! m `
97+ endif
98+ call cursor (pos)
99+ if is_win_moved
100+ doautocmd WinEnter *
91101 endif
92102endfunction
93103
@@ -560,7 +570,7 @@ endfunction
560570" @param {number} winnr
561571function ! s: move_to_win (winnr ) abort
562572 if a: winnr !=# winnr ()
563- execute a: winnr . ' wincmd w'
573+ execute ' noautocmd ' a: winnr . ' wincmd w'
564574 endif
565575endfunction
566576
You can’t perform that action at this time.
0 commit comments