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

Keyboard shortcut editor.action.selectHighlights selects only first 999 matches #11973

Closed
coe-jeubanks opened this issue Sep 13, 2016 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Milestone

Comments

@coe-jeubanks
Copy link

  • VSCode Version: 1.5.2
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create a file with more than 999 examples of a text string (e.g. 2,000 lines containing "This is a line").
  2. Highlight a word or phrase, and to highlight all matches, press ctrl+shift+l (or whatever editor.action.selectHighlights has been mapped to).

Only the first 999 matches will be selected. This is a problem when working with large files.

@Bill-Stewart
Copy link

Just wondering if editor.action.changeAll (default ctrl+f2) has the same behavior?

@coe-jeubanks
Copy link
Author

Yes, editor.action.changeAll exhibits the same behavior. I realized after posting this issue that it's likely an arbitrary cutoff for performance purposes. To be my go-to text editor, however, VS Code really needs to add the ability to edit large files. I hope that's on the horizon.

@Bill-Stewart
Copy link

Or at least make it user configurable...

@coe-jeubanks
Copy link
Author

I should note that the regular Replace function (ctrl+H) replaces as many matches as it can find in the file. In the Find dialog box, it shows "1 of 999+", and the ToolTip says "Only the first 999 results have been highlighted, but all Find operations work on the entire text". Seems to me this philosophy should be extended to editor.action.selectHighlights and editor.action.changeAll operations.

@Bill-Stewart
Copy link

Related to #7577 ?

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug feature-request Request for new features or functionality labels Sep 20, 2016
@alexdima alexdima added this to the Backlog milestone Sep 20, 2016
@ToMakeSense
Copy link

ToMakeSense commented Jul 19, 2017

Related to #496 #5887 #7201 #32522..... all kinds of 999-Issues.
this bug really exists in a long period. Hope can be fixed soon. And I also think 1 of 999+ isn't good practice, Just want to know how many cases exactly are found when I do a search(Ctrl+F).

Sublime Text 3 shows it in status bar, I think it's very useful.
image

@ToMakeSense
Copy link

ToMakeSense commented Aug 16, 2017

@alexandrudima I think I have find the reazon for this bug:

  1. see this issues #15778 or #7577
    Ctrl+F then Alt+Enter will work for "editor.action.selectHighlights"

  2. But ctrl+shift+L does't. Look at the settings
    image
    image
    I think the ctrl+shift+L should bind to editor.action.selectAllMatches when editorTextFocus , that is to say: editor.action.selectHighlights is misunderstood or has bug.

@Mischala
Copy link

So, I wrote about this in #7201 but its worth mentioning here.

Line 173 of findModel.ts references a "MATCHES_LIMIT", that is a constant, set on line 70 of the same file.
This appears to be the root of the problem.
I expect the reason this limit exists is to stop "Bad Searches" like searching for "s" or whitespace from running forever and locking up the app.

@alexdima
Copy link
Member

Duplicate of #5887

@alexdima alexdima marked this as a duplicate of #5887 Sep 28, 2017
@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 28, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants