From 886dd7f37a07d6b0df497a2675a099f5ce42a6f9 Mon Sep 17 00:00:00 2001 From: timsu92 <33785401+timsu92@users.noreply.github.com> Date: Mon, 29 Aug 2022 21:44:15 +0800 Subject: [PATCH] fix: prevent moving cursor inside a fold See easymotion/vim-easymotion#484 for the background. Fix: #383, Fix: #452 Close: #484 Co-authored-by: @Nealium --- autoload/EasyMotion.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index 2a472237..9519b38d 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -1303,7 +1303,7 @@ function! s:EasyMotion(regexp, direction, visualmode, is_inclusive, ...) " {{{ if search_direction ==# 'b' " FIXME: Hmm... I should use filter() " keepjumps call cursor(foldclosed(pos[0]), 0) - else + elseif foldclosedend(pos[0]+1) != -1 keepjumps call cursor(foldclosedend(pos[0]+1), 0) endif else