diff options
author | Pascal Kuthe | 2023-01-18 21:28:47 +0000 |
---|---|---|
committer | GitHub | 2023-01-18 21:28:47 +0000 |
commit | 0e5159ceca6be34977349156a32cc1a3ec53ab6e (patch) | |
tree | 50ca3e9fcf5f535c57d90a861c9417c7b5ac4659 /helix-term | |
parent | 4d7082eb5c432e3cf0ff0fed565e8b1438d09ad8 (diff) |
Fix panic for noop selecting join (#5579)
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/commands.rs | 5 |
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(); |