Open
Conversation
lhecker
approved these changes
Feb 18, 2026
| // - pos - the buffer position being within the current delimiter class | ||
| // - wordDelimiters - what characters are we considering for the separation of words | ||
| til::point TextBuffer::_GetDelimiterClassRunEnd(til::point pos, const std::wstring_view wordDelimiters) const | ||
| // - accessibilityMode - when true, cross non-wrapped row boundaries freely |
Member
There was a problem hiding this comment.
So, in essence, this is "if false, add CRLF/newlines to the wordDelemiters list", right?
DHowett
reviewed
Feb 24, 2026
Member
DHowett
left a comment
There was a problem hiding this comment.
I think we need to test conhost, expressly, with this change. I'm afraid of the test values changing--because my mental model is that a refactor shouldn't also require us to change the tests (how would we ensure the refactor was correct if the original tests didn't pass?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Simplifies the word expansion functions in TextBuffer by removing the following functions:
GetWordStart2()GetWordEnd2()MoveToNextWord()MoveToPreviousWord()_GetWordStartForAccessibility()_GetWordStartForSelection()_GetWordEndForAccessibility()_GetWordEndForSelection()In favor of a simple:
GetWordStart()GetWordEnd()_GetDelimiterClassRunEnd()Tests were used to help ensure a regression doesn't occur. That said, there were a few modifications there too:
MoveByWordtestMoveToNextWord()andMoveToPreviousWord(), which no longer exist. These were helper functions forUiaTextRangeBase, and any special logic has been moved into_moveEndpointByUnitWordusing the unifiedGetWordStart()/GetWordEnd()APIs.MoveToPreviousWord,MovementAtExclusiveEnd, and the generated word movement tests.GetWordBoundariestestsGetWordEnd(): The old_GetWordEndForSelection()returned inclusive end positions, whereas the newGetWordEnd()returns exclusive end positions. This is whatGetWordEnd2()already used, so every old expected value shifted +1 in the x direction (or to {RightExclusive, y} at row boundaries) to account for that.ControlCharwrap-crossing behavior: The old_GetWordStartForSelection()had a special check at the left boundary that prevented whitespace runs from crossing wrapped row boundaries. The new_GetDelimiterClassRunStart()doesn't have this special case (it treats ControlChar the same as other delimiter classes when the row was wrap-forced). This changed one test case:GetWordStart({1, 4})in selection mode went from{0, 4}to{6, 3}(the whitespace run now crosses the wrap boundary to row 3). This matches the behavior TerminalSelection was already getting fromGetWordStart2().Validation Steps Performed
Tests passed:
✅ Conhost.Interactivity.Win32.Unit.Tests.dll
✅ UnitTests_TerminalCore\Terminal.Core.Unit.Tests.dll
Word navigation feels good for...
✅ Narrator
✅ NVDA
✅ Mouse selection
✅ Mark mode
Closes #4423