From 2288bf7db25d458f8bfb49579bab4d1f634b1559 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 4 Apr 2022 23:05:42 +0800 Subject: [PATCH] fix(iedit): handle empty cursor_stack --- autoload/SpaceVim/plugins/iedit.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/plugins/iedit.vim b/autoload/SpaceVim/plugins/iedit.vim index b51e0cdaa..7bb753d06 100644 --- a/autoload/SpaceVim/plugins/iedit.vim +++ b/autoload/SpaceVim/plugins/iedit.vim @@ -204,7 +204,7 @@ function! SpaceVim#plugins#iedit#start(...) abort endif call s:highlight_cursor() redrawstatus! - while s:mode !=# '' + while s:mode !=# '' && len(s:cursor_stack) > 0 redraw! let char = s:VIM.getchar() if s:mode ==# 'n' && char ==# "\" @@ -213,6 +213,10 @@ function! SpaceVim#plugins#iedit#start(...) abort let symbol = s:handle(s:mode, char) endif endwhile + if len(s:cursor_stack) == 0 + normal! : + echo 'Pattern not found:' . symbol + endif let s:cursor_stack = [] let s:index = -1 let s:mode = ''