From 144cc5c3fccd229078aaa0758bf684839897e406 Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Sun, 11 Aug 2024 17:34:51 +0200 Subject: [PATCH] Stop macro execution after a failed search --- .../com/maddyhome/idea/vim/action/ex/ProcessExEntryActions.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/action/ex/ProcessExEntryActions.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/action/ex/ProcessExEntryActions.kt index 9095159c0..fc519b7b0 100644 --- a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/action/ex/ProcessExEntryActions.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/action/ex/ProcessExEntryActions.kt @@ -88,8 +88,7 @@ class ProcessSearchEntryAction(private val parentAction: ProcessExEntryAction) : else -> throw ExException("Unexpected search label ${argument.label}") } - // Vim doesn't treat not finding something as an error, although it might report either an error or warning message - if (offsetAndMotion == null) return Motion.NoMotion + if (offsetAndMotion == null) return Motion.Error parentAction.motionType = offsetAndMotion.second return offsetAndMotion.first.toMotionOrError() }