Revisit TerminalSelection to add tests, clean up, proper selection mechanics #1758

Open
opened 2026-01-30 22:35:44 +00:00 by claunia · 0 comments
Owner

Originally created by @carlos-zamora on GitHub (Jun 19, 2019).

Originally assigned to: @carlos-zamora on GitHub.

More of a mental note of all the misc. selection stuff I need to do. Hopefully I can get this in very soon so that we can verify that nothing was broken.

  • Add testing for the following scenarios:
    • endSelectionPosition being located out of bounds
  • _GetSelectionRects() clean up
    • the pre-processing part is just a bit nasty now. There should be a way to simplify it. Need to be careful with testing this though.
  • Proper selection mechanics
    • when your endSelectionPosition is out of bounds vertically, the x-position should still update, but the y-position should be at the boundary
    • when your endSelectionPosition is out of bounds horizontally, the y-position should still update, but the y-position should be at the buffer boundary
    • this is particularly important for #1247. As the y-position must be detected to be out of the bounds, so that's still valid. But it should be displayed as updating the x-position.
Originally created by @carlos-zamora on GitHub (Jun 19, 2019). Originally assigned to: @carlos-zamora on GitHub. More of a mental note of all the misc. selection stuff I need to do. Hopefully I can get this in very soon so that we can verify that nothing was broken. - [x] Add testing for the following scenarios: - [x] `endSelectionPosition` being located out of bounds - [ ] `_GetSelectionRects()` clean up - the pre-processing part is just a bit nasty now. There should be a way to simplify it. Need to be careful with testing this though. - [x] Proper selection mechanics - when your `endSelectionPosition` is out of bounds **vertically**, the x-position should still update, but the y-position should be at the boundary - when your `endSelectionPosition` is out of bounds **horizontally**, the y-position should still update, but the y-position should be at the **buffer** boundary - this is particularly important for #1247. As the y-position must be detected to be out of the bounds, so that's still valid. But it should be displayed as updating the x-position.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1758