Refactor Word Expansion in TextBuffer #6224

Open
opened 2026-01-31 00:32:49 +00:00 by claunia · 0 comments
Owner

Originally created by @carlos-zamora on GitHub (Jan 31, 2020).

Originally assigned to: @carlos-zamora on GitHub.

Description of the new feature/enhancement

In #4018, word navigation for selection and accessibility is merged into this mess:

  • GetWordEnd (with accessibilityMode flag)
  • GetWordStart (with accessibilityMode flag)
  • MoveToNextWord
  • MoveToPreviousWord

There has to be a way to combine all of these into just 2 functions (or 4 with an accessibilityMode flag). Unfortunately, doing so at the time could have resulted in breaking Selection for the sake of Accessibility (if one was not careful). So here's a work item to refactor that and make it look waaaaay better.

Proposed technical implementation details (optional)

There's a good amount of repeated code/concepts throughout these functions. I think we should just rely on making the function return a bool and have an in/out param.

Originally created by @carlos-zamora on GitHub (Jan 31, 2020). Originally assigned to: @carlos-zamora on GitHub. # Description of the new feature/enhancement In #4018, word navigation for selection and accessibility is merged into this mess: - `GetWordEnd` (with `accessibilityMode` flag) - `GetWordStart` (with `accessibilityMode` flag) - `MoveToNextWord` - `MoveToPreviousWord` There _has_ to be a way to combine all of these into just 2 functions (or 4 with an accessibilityMode flag). Unfortunately, doing so at the time could have resulted in breaking Selection for the sake of Accessibility (if one was not careful). So here's a work item to refactor that and make it look _waaaaay_ better. # Proposed technical implementation details (optional) There's a good amount of repeated code/concepts throughout these functions. I think we should just rely on making the function return a bool and have an in/out param.
claunia added the Issue-TaskProduct-TerminalArea-CodeHealth labels 2026-01-31 00:32:49 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6224