From 0a4432b104099534f7a25b8ea4148234db146ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Carneiro?= Date: Fri, 2 Aug 2024 09:04:19 -0300 Subject: [PATCH] Add statusline errors when nothing is selected with `s`, `K`, `A-K` (#11370) --- helix-term/src/commands.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e9d3a28ff..4e97f36b3 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1939,6 +1939,8 @@ fn select_regex(cx: &mut Context) { selection::select_on_matches(text, doc.selection(view.id), ®ex) { doc.set_selection(view.id, selection); + } else { + cx.editor.set_error("nothing selected"); } }, ); @@ -4624,6 +4626,8 @@ fn keep_or_remove_selections_impl(cx: &mut Context, remove: bool) { selection::keep_or_remove_matches(text, doc.selection(view.id), ®ex, remove) { doc.set_selection(view.id, selection); + } else { + cx.editor.set_error("no selections remaining"); } }, )