[PR #7530] Keep degenerate UIA text ranges degenerate after movement #26941

Open
opened 2026-01-31 09:19:02 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/7530

State: closed
Merged: Yes


Conhost expands UIA text ranges when moved. This means that degenerate
ranges become non-degenerate after movement, leading to odd behaviour
from UIA clients. This PR doesn't expand degenerate ranges, but rather
keeps them degenerate by moving _end to the newly-changed _start.

Tested in the NVDA Python console (cases with setEndPoint and
compareEndPoints described in #7342). Also ran the logic by
@michaeldcurran.

Closes #7342 and nvaccess/nvda#11288

Also fixes an issue privately reported to
me by @simon818 with copy/paste from review cursor which originally lead
me to believe the issue was with moveEndPointByRange.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/7530 **State:** closed **Merged:** Yes --- Conhost expands UIA text ranges when moved. This means that degenerate ranges become non-degenerate after movement, leading to odd behaviour from UIA clients. This PR doesn't expand degenerate ranges, but rather keeps them degenerate by moving `_end` to the newly-changed `_start`. Tested in the NVDA Python console (cases with `setEndPoint` and `compareEndPoints` described in #7342). Also ran the logic by @michaeldcurran. Closes #7342 and nvaccess/nvda#11288 Also fixes an issue privately reported to me by @simon818 with copy/paste from review cursor which originally lead me to believe the issue was with `moveEndPointByRange`.
claunia added the pull-request label 2026-01-31 09:19:02 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26941