on master help sign in
Fix panic for noop selecting join (#5579)
commit0e5159ceca6be34977349156a32cc1a3ec53ab6e authorPascal Kuthe <pascal.kuthe@semimod.de> dateWed 18 Jan 2023, 22:28 (4 years ago) parent4d7082e
1 file changed+5
helix-term/src/commands.rs+5
helix-term/src/commands.rs+5
@@ -3939,6 +3939,11 @@ fn join_selections_impl(cx: &mut Context, select_space: bool) {
39393939 }
39403940 }
39413941
3942+ // nothing to do, bail out early to avoid crashes later
3943+ if changes.is_empty() {
3944+ return;
3945+ }
3946+
39423947 changes.sort_unstable_by_key(|(from, _to, _text)| *from);
39433948 changes.dedup();
39443949