From fc7d1d9a5d3378313c521d5bc5f410d9d3e2302a Mon Sep 17 00:00:00 2001 From: haya14busa Date: Thu, 21 Jan 2016 17:21:43 +0900 Subject: [PATCH] Make sure the autocmd event exists before doautocmd --- autoload/vital/_easymotion/HitAHint/Motion.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/vital/_easymotion/HitAHint/Motion.vim b/autoload/vital/_easymotion/HitAHint/Motion.vim index da57600..eb716ad 100644 --- a/autoload/vital/_easymotion/HitAHint/Motion.vim +++ b/autoload/vital/_easymotion/HitAHint/Motion.vim @@ -106,13 +106,15 @@ function! s:move_to_winpos(winpos) abort let winnr = str2nr(winnr_str) let is_win_moved = !(winnr is# winnr()) if is_win_moved - doautocmd WinLeave * + if exists('#WinLeave') + doautocmd WinLeave * + endif call s:move_to_win(winnr) else normal! m` endif call cursor(pos) - if is_win_moved + if is_win_moved && exists('#WinEnter') doautocmd WinEnter * endif endfunction