Skip to content

Commit fc7d1d9

Browse files
committed
Make sure the autocmd event exists before doautocmd
1 parent 65ee835 commit fc7d1d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

autoload/vital/_easymotion/HitAHint/Motion.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ function! s:move_to_winpos(winpos) abort
106106
let winnr = str2nr(winnr_str)
107107
let is_win_moved = !(winnr is# winnr())
108108
if is_win_moved
109-
doautocmd WinLeave *
109+
if exists('#WinLeave')
110+
doautocmd WinLeave *
111+
endif
110112
call s:move_to_win(winnr)
111113
else
112114
normal! m`
113115
endif
114116
call cursor(pos)
115-
if is_win_moved
117+
if is_win_moved && exists('#WinEnter')
116118
doautocmd WinEnter *
117119
endif
118120
endfunction

0 commit comments

Comments
 (0)