on master help sign in
Fix panic for noop selecting join (#5579)
0e5159cPascal Kuthe
helix-term/src/commands.rs+5
@@ -3939,6 +3939,11 @@ fn join_selections_impl(cx: &mut Context, select_space: bool) {
3939 }
3939 }
3940 }
3940 }
3941
3941
3942+ // nothing to do, bail out early to avoid crashes later
3943+ if changes.is_empty() {
3944+ return;
3945+ }
3946+
3942 changes.sort_unstable_by_key(|(from, _to, _text)| *from);
3947 changes.sort_unstable_by_key(|(from, _to, _text)| *from);
3943 changes.dedup();
3948 changes.dedup();
3944
3949