Skip to content

Conversation

@carlos-zamora
Copy link
Member

Summary of the Pull Request

Fixes a bug where the color selection actions would color one more character than they needed to.
Also fixes a bug where if mark mode was used to create the selection, a dangling y-beam would be left over after executing the action.
 

References and Relevant Issues

Regressed in #18106

Detailed Description of the Pull Request / Additional comments

  • TextBuffer::SpanLength was only used once (in Terminal::ColorSelection). All it really did was call Viewport::CompareInBounds. So I deduplicated it.
    • Funny enough, the +1 added there was no longer correct because the incoming coordinates were switched from an inclusive range to an exclusive range.
  • To fix the dangling y-beam, I added a call to _updateSelectionUI in ControlCore::ColorSelection. This heuristic is used throughout the file for other selection-related functions.

Validation Steps Performed

✅ color selection action highlights reference(s) to selected text
✅ color selection action highlights reference(s) to selected text when text is at right boundary
✅ dangling y-beam disappears after executing color selection actions

Closes #18739

@DHowett DHowett merged commit 0b4f966 into main Apr 15, 2025
19 checks passed
@DHowett DHowett deleted the dev/cazamor/fix-color-sln branch April 15, 2025 04:18
DHowett pushed a commit that referenced this pull request Apr 16, 2025
(cherry picked from commit 0b4f966)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgZYtao
Service-Version: 1.23
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.

"Color selection" off-by-one regression: it colors 1 cell past the end

4 participants