I found an edge case in the search extension where a matched keyword is not selected when the "next" button is triggered.
Steps to reproduce:
Navigate to the sandbox page. The example document is console.log('hello')\n.
While the cursor focuses the editor, press Ctrl/Cmd-f to bring up the search panel.
In the search field, type a c. The first character is highlighted in yellow.
Press Enter. The c is highlighted in orange as an indicator for the current search cursor.
Type con in the search field. Press Enter again.
con should be highlighted in orange, but it stays in yellow.
The logic is that the selection is landing on the next non-overlapping match across queries. This issue is not as obvious if the next query matches the document more than once. In such scenario, the selection in the last step jumps to the next match. Not ideal, but the user can be convinced that it can be navigated back by a Shift-Enter.
Demo: (I have added a seach config for this recording)
Describe the issue
I found an edge case in the search extension where a matched keyword is not selected when the "next" button is triggered.
Steps to reproduce:
console.log('hello')\n
.c
. The first character is highlighted in yellow.c
is highlighted in orange as an indicator for the current search cursor.con
in the search field. Press Enter again.con
should be highlighted in orange, but it stays in yellow.The logic is that the selection is landing on the next non-overlapping match across queries. This issue is not as obvious if the next query matches the document more than once. In such scenario, the selection in the last step jumps to the next match. Not ideal, but the user can be convinced that it can be navigated back by a Shift-Enter.
Demo: (I have added a seach config for this recording)
https://github.com/user-attachments/assets/b2243816-4072-43d1-8576-a122b0f83919
Browser and platform
N/A
Reproduction link
No response