Commit 19a8501
authored
mark mode: begin selection at focused search result (#19550)
## Summary of the Pull Request
Searching in terminal highlights all search results. However, those
results are considered separate from a selection. In the past, the
highlighted result would be selected, resulting in it being the initial
position for mark mode. Now that it's separate, mark mode doesn't start
there.
To fix this, there's 2 changes here:
1. When we exit the search, we now select the focused search result.
This becomes the initial position for mark mode.
2. When we're in the middle of a search and mark mode becomes enabled,
the focused search result becomes the initial position for mark mode.
With this change, mark mode's initial position is determined in this
order:
1. the position of an active selection
2. the position of the focused search result (if one is available)
3. the top-left position of the viewport (if there is a scrollback) (see
#19549)
4. the current cursor position
## Validation Steps Performed
Entering mark mode in scenario X results in a starting position of Y:
✅ selected text during a search --> selected text
- NOTE: this seems to only occur if you start a search, then manually
click on the terminal to bring focus there, but keep the search results
active
✅ performed a search and results are available -->focused search result
✅ performed a search and no results are available
- scrolled up --> top-left of viewport
- no scrollback --> cursor position
✅ performed a search, got results, then closed search --> focused search
result
Closes #193581 parent 898b9e3 commit 19a8501
File tree
2 files changed
+31
-7
lines changed- src/cascadia
- TerminalControl
- TerminalCore
2 files changed
+31
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1787 | 1787 | | |
1788 | 1788 | | |
1789 | 1789 | | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
1790 | 1799 | | |
1791 | 1800 | | |
1792 | 1801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
366 | 386 | | |
367 | 387 | | |
368 | | - | |
| 388 | + | |
369 | 389 | | |
370 | 390 | | |
371 | 391 | | |
| |||
377 | 397 | | |
378 | 398 | | |
379 | 399 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | 400 | | |
386 | 401 | | |
387 | 402 | | |
| |||
0 commit comments