[PR #13244] [MERGED] Remove most uses of CompareInBounds #29439

Closed
opened 2026-01-31 09:34:55 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/13244
Author: @carlos-zamora
Created: 6/8/2022
Status: Merged
Merged: 7/1/2022
Merged by: @undefined

Base: mainHead: dev/cazamor/remove-compareInBounds


📝 Commits (7)

  • 9596b06 Remove most uses of CompareInBounds
  • 4ce925e address PR comments
  • b105d68 clamp to inclusive pos & compare returns 0/1
  • e9b2ffc fix test
  • e0695ec make 'MoveToNextGlyph' prettier
  • 49c33d9 Merge branch 'main' into dev/cazamor/remove-compareInBounds
  • c98940a backwards

📊 Changes

6 files changed (+55 additions, -63 deletions)

View changed files

📝 src/buffer/out/textBuffer.cpp (+20 -10)
📝 src/cascadia/TerminalCore/TerminalSelection.cpp (+3 -3)
📝 src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp (+2 -2)
📝 src/types/UiaTextRangeBase.cpp (+23 -29)
📝 src/types/inc/viewport.hpp (+2 -2)
📝 src/types/viewport.cpp (+5 -17)

📄 Description

Summary of the Pull Request

Replaces most uses of Viewport::CompareInBounds() with til::point's < and > operators. CompareInBounds has been the cause of a bunch of UIA crashes over the years. Replacing them entirely ensures that the FAILFAST_IF isn't ever touched.

Unfortunately, we still need IncrementInBounds and DecrementInBounds to have support for that exclusive end.

References

#13183


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/13244 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 6/8/2022 **Status:** ✅ Merged **Merged:** 7/1/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/remove-compareInBounds` --- ### 📝 Commits (7) - [`9596b06`](https://github.com/microsoft/terminal/commit/9596b06bffe65a2941f6d7a4fcc0dd9ed4d40eb0) Remove most uses of `CompareInBounds` - [`4ce925e`](https://github.com/microsoft/terminal/commit/4ce925ede855923ca78fb88f66d56efe315545ea) address PR comments - [`b105d68`](https://github.com/microsoft/terminal/commit/b105d68a26193058f985be903cd8a884fa8fcc49) clamp to inclusive pos & compare returns 0/1 - [`e9b2ffc`](https://github.com/microsoft/terminal/commit/e9b2ffc4554688a4d5dca9995d27801c09a4b8fe) fix test - [`e0695ec`](https://github.com/microsoft/terminal/commit/e0695ec1404cb1a3f1185cf7bdb625a5a5b32d19) make 'MoveToNextGlyph' prettier - [`49c33d9`](https://github.com/microsoft/terminal/commit/49c33d906bf6f2db737cdf95b551c03faa0adcb2) Merge branch 'main' into dev/cazamor/remove-compareInBounds - [`c98940a`](https://github.com/microsoft/terminal/commit/c98940a95b256e3955877f66eb2891f7070da663) backwards ### 📊 Changes **6 files changed** (+55 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/textBuffer.cpp` (+20 -10) 📝 `src/cascadia/TerminalCore/TerminalSelection.cpp` (+3 -3) 📝 `src/interactivity/win32/ut_interactivity_win32/UiaTextRangeTests.cpp` (+2 -2) 📝 `src/types/UiaTextRangeBase.cpp` (+23 -29) 📝 `src/types/inc/viewport.hpp` (+2 -2) 📝 `src/types/viewport.cpp` (+5 -17) </details> ### 📄 Description ## Summary of the Pull Request Replaces most uses of `Viewport::CompareInBounds()` with `til::point`'s `<` and `>` operators. `CompareInBounds` has been the cause of a bunch of UIA crashes over the years. Replacing them entirely ensures that the `FAILFAST_IF` isn't ever touched. Unfortunately, we still need `IncrementInBounds` and `DecrementInBounds` to have support for that exclusive end. ## References #13183 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:34:55 +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#29439