@@ -3939,6 +3939,11 @@ fn join_selections_impl(cx: &mut Context, select_space: bool) {
3942+ // nothing to do, bail out early to avoid crashes later
3943+ if changes.is_empty() {
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();