Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command and Keybinding for adding multi cursor from search result #82510

Merged
merged 6 commits into from Nov 26, 2019

Conversation

@njkevlani
Copy link
Contributor

njkevlani commented Oct 14, 2019

This PR fixes #81407

options: {
preserveFocus: false,
pinned: true,
selection,

This comment has been minimized.

Copy link
@roblourens

roblourens Oct 16, 2019

Member

Is this selection necessary since you select everything in the next block?

This comment has been minimized.

Copy link
@njkevlani

njkevlani Oct 21, 2019

Author Contributor

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.

This comment has been minimized.

Copy link
@roblourens

roblourens Oct 21, 2019

Member

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?

This comment has been minimized.

Copy link
@njkevlani

njkevlani Oct 23, 2019

Author Contributor

This does not work for regex. I'll fix it with a commit in a few days :)

Copy link
Contributor Author

njkevlani left a comment

options: {
preserveFocus: false,
pinned: true,
selection,

This comment has been minimized.

Copy link
@njkevlani

njkevlani Oct 21, 2019

Author Contributor

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.
@njkevlani

This comment has been minimized.

Copy link
Contributor Author

njkevlani commented Oct 29, 2019

@roblourens Review please :)

@roblourens roblourens added this to the November 2019 milestone Oct 29, 2019
@njkevlani

This comment has been minimized.

Copy link
Contributor Author

njkevlani commented Nov 4, 2019

@roblourens Any idea why did check fail?

roblourens added 2 commits Nov 12, 2019
let isRegex = this.searchWidget.searchInput.getRegex();
let isWholeWords = this.searchWidget.searchInput.getWholeWords();
let isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive();
let contentPattern = this.searchWidget.searchInput.getValue();

This comment has been minimized.

Copy link
@roblourens

roblourens Nov 12, 2019

Member

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?

This comment has been minimized.

Copy link
@njkevlani

njkevlani Nov 13, 2019

Author Contributor

Two questions:

  1. How do I get all the matches in searchView.ts?
  2. Should I create a public wrapper method for _setSelections method and use that in searchView.ts or this task need to be done in some other way?

This comment has been minimized.

Copy link
@roblourens

roblourens Nov 19, 2019

Member

You have the matches right here in the FileMatchOrMatch

This comment has been minimized.

Copy link
@njkevlani

njkevlani Nov 24, 2019

Author Contributor

Review please @roblourens

@roblourens

This comment has been minimized.

Copy link
Member

roblourens commented Nov 12, 2019

Sorry for the slow review, I was at a conference

Copy link
Member

roblourens left a comment

Looks good now, but pleae fix the merge conflicts

@roblourens roblourens merged commit 15fea5e into microsoft:master Nov 26, 2019
5 checks passed
5 checks passed
linux
Details
windows
Details
darwin
Details
VS Code #20191125.2 succeeded
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.