Command and Keybinding for adding multi cursor from search result#82510
Command and Keybinding for adding multi cursor from search result#82510roblourens merged 6 commits intomicrosoft:masterfrom njkevlani:feature/multi-cursor-on-search
Conversation
| options: { | ||
| preserveFocus: false, | ||
| pinned: true, | ||
| selection, |
There was a problem hiding this comment.
Is this selection necessary since you select everything in the next block?
There was a problem hiding this comment.
Yes, this selection is necessary, because the next block that selects everything uses this selection (via let findController = CommonFindController.get(codeEditor)).
What that block does is, select all occurrences of what is selected right now.
There was a problem hiding this comment.
I see, I was misunderstanding. I think this isn't exactly what we want then because it should select all of the matches from the search view, not "all occurrences of what is selected right now".
For example, all the matches could be different if you are matching a regex, and some identical text in a different place in the document may not actually match. Does this work without the second block at all?
There was a problem hiding this comment.
This does not work for regex. I'll fix it with a commit in a few days :)
njkevlani
left a comment
There was a problem hiding this comment.
ping @roblourens
| options: { | ||
| preserveFocus: false, | ||
| pinned: true, | ||
| selection, |
There was a problem hiding this comment.
Yes, this selection is necessary, because the next block that selects everything uses this selection (via let findController = CommonFindController.get(codeEditor)).
What that block does is, select all occurrences of what is selected right now.
Created function selectAllUsingString for this purpose.
|
@roblourens Review please :) |
|
@roblourens Any idea why did check fail? |
| let isRegex = this.searchWidget.searchInput.getRegex(); | ||
| let isWholeWords = this.searchWidget.searchInput.getWholeWords(); | ||
| let isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive(); | ||
| let contentPattern = this.searchWidget.searchInput.getValue(); |
There was a problem hiding this comment.
This is coming from the search input, not the query, so the user could have changed this without rerunning the search, then it won't be the same, right?
Actually, can we avoid triggering a find, and just select the exact ranges that are in the actual match?
There was a problem hiding this comment.
Two questions:
- How do I get all the matches in
searchView.ts? - Should I create a public wrapper method for _setSelections method and use that in
searchView.tsor this task need to be done in some other way?
There was a problem hiding this comment.
You have the matches right here in the FileMatchOrMatch
|
Sorry for the slow review, I was at a conference |
roblourens
left a comment
There was a problem hiding this comment.
Looks good now, but pleae fix the merge conflicts
This PR fixes #81407