From cf6650d8f81ab446a17fe6395680b5a210a317b0 Mon Sep 17 00:00:00 2001 From: zhihua Date: Wed, 10 Sep 2025 10:17:51 +0800 Subject: [PATCH] Add catch for `E385` and `E384` to prevent errors at search boundaries when `set nowrapscan` is enabled. Error detected while processing function WordNavigation[30]..function WordNavigation: line 24: E385: Search hit BOTTOM without match for: *** --- plugin/interestingwords.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/interestingwords.vim b/plugin/interestingwords.vim index ec1dc38..c7a32d5 100644 --- a/plugin/interestingwords.vim +++ b/plugin/interestingwords.vim @@ -120,8 +120,14 @@ function! WordNavigation(direction) else normal! N endif - catch /E486/ - echohl WarningMsg | echomsg "E486: Pattern not found: " . @/ + catch /^Vim\%((\a\+)\)\=:\%(E486\|E385\|E384\)/ + if v:exception =~ 'E486' + echohl WarningMsg | echomsg "E486: Pattern not found: " . @/ + elseif v:exception =~ 'E385' + echohl MoreMsg | echomsg "Search hit BOTTOM" + elseif v:exception =~ 'E384' + echohl MoreMsg | echomsg "Search hit TOP" + endif endtry endif endfunction