aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorPascal Kuthe2023-01-18 21:28:47 +0000
committerGitHub2023-01-18 21:28:47 +0000
commit0e5159ceca6be34977349156a32cc1a3ec53ab6e (patch)
tree50ca3e9fcf5f535c57d90a861c9417c7b5ac4659 /helix-term/src
parent4d7082eb5c432e3cf0ff0fed565e8b1438d09ad8 (diff)
Fix panic for noop selecting join (#5579)
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 5b3ce68e..8b742d00 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -3939,6 +3939,11 @@ fn join_selections_impl(cx: &mut Context, select_space: bool) {
}
}
+ // nothing to do, bail out early to avoid crashes later
+ if changes.is_empty() {
+ return;
+ }
+
changes.sort_unstable_by_key(|(from, _to, _text)| *from);
changes.dedup();