Unnamed repository; edit this file 'description' to name the repository.
Add statusline errors when nothing is selected with `s`, `K`, `A-K` (#11370)
André Carneiro 2024-08-02
parent cfe80ac · commit 0a4432b
-rw-r--r--helix-term/src/commands.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index e9d3a28f..4e97f36b 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), &regex)
{
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), &regex, remove)
{
doc.set_selection(view.id, selection);
+ } else {
+ cx.editor.set_error("no selections remaining");
}
},
)