Skip to content

Fix: Esc does not clear primary selection when dismissing column block#166

Merged
tig merged 3 commits into
developfrom
copilot/fix-primary-selection-issue
May 19, 2026
Merged

Fix: Esc does not clear primary selection when dismissing column block#166
tig merged 3 commits into
developfrom
copilot/fix-primary-selection-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

The Esc handler called ClearAdditionalCarets() but never cleared the primary row's selection, leaving it highlighted and type-replaceable after dismissing multi-caret mode.

  • Editor.Keyboard.cs: Add ClearSelection() after ClearAdditionalCarets() in the Esc path
  • EditorColumnSelectionTests.cs: Assert !HasSelection after Esc
  • Snapshot: Updated golden .ans (selection highlight no longer rendered)
if (key == Application.GetDefaultKey (Command.Quit) && HasMultipleCarets)
{
    ClearAdditionalCarets ();
    ClearSelection ();

    return true;
}

tig and others added 2 commits May 18, 2026 21:50
…-caret)

The Esc handler called ClearAdditionalCarets() but never cleared the
primary row's selection, leaving it highlighted and type-replaceable.
Now calls ClearSelection() immediately after, matching the documented
"collapse back to the primary caret" behavior.

Fixes #143

Agent-Logs-Url: https://github.com/gui-cs/Editor/sessions/9ff74825-e83a-4e36-9a03-dd9317677001

Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Esc not clearing primary selection in column block Fix: Esc does not clear primary selection when dismissing column block May 19, 2026
Copilot finished work on behalf of tig May 19, 2026 02:51
Copilot AI requested a review from tig May 19, 2026 02:51
@tig tig marked this pull request as ready for review May 19, 2026 02:51
@tig tig merged commit 72d3779 into develop May 19, 2026
8 checks passed
@tig tig deleted the copilot/fix-primary-selection-issue branch May 19, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Esc does not clear the primary selection when dismissing a column block (multi-caret)

2 participants