From 2cf4ce235662fcb272c684751b844b2ebc1b757f Mon Sep 17 00:00:00 2001 From: gibbz00 Date: Thu, 9 Mar 2023 05:08:28 +0100 Subject: Fix `shrink_selection` with multiple cursors. (#6093) * Fix #6092 Cause were some incorrect assumptions that missed an edge case in the `Selection.contains()` calculation. Tests were added accordingly. * Fix Selection.contains() edge-case handling. Removing the len check short-circuit was the only thing needed as pointed out by @dead10ck.--- helix-term/src/commands.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'helix-term/src/commands.rs') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 6817bc5c..803f4051 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4371,7 +4371,6 @@ fn shrink_selection(cx: &mut Context) { // try to restore previous selection if let Some(prev_selection) = view.object_selections.pop() { if current_selection.contains(&prev_selection) { - // allow shrinking the selection only if current selection contains the previous object selection doc.set_selection(view.id, prev_selection); return; } else { -- cgit v1.2.3-70-g09d2