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

"Select All Occurrences" is not selecting all of matches in large files (stops at 1000) #7201

Closed
FrenchBen opened this issue Jun 3, 2016 · 5 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-core Editor basic functionality editor-multicursor Editor multiple cursor issues feature-request Request for new features or functionality
Milestone

Comments

@FrenchBen
Copy link

FrenchBen commented Jun 3, 2016

  • VSCode Version: 1.1.1
  • OS Version: 10.11.4

Steps to Reproduce:

  1. Open a 3MB file with some repeating text at each line (The quick brown fox jumps over the lazy dog
  2. Highlight a word such as quick
  3. Do a multi-cursor select (CMD+SHIFT+L)
  4. Edit quick to say slow
  5. Notice that not all lines were changed :( (stops at line 999 of a 35,397 line file)
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Jun 6, 2016
@alexdima alexdima changed the title Multiple cursor large file "Select All Occurrences" is not selecting all of matches in large files (stops at 1000) Mar 2, 2017
@alexdima alexdima added feature-request Request for new features or functionality editor-multicursor Editor multiple cursor issues editor-core Editor basic functionality and removed bug Issue identified by VS Code Team member as probable bug labels Mar 2, 2017
@alexdima alexdima added this to the Backlog milestone Mar 2, 2017
@russgalloway
Copy link

I've been experiencing the same. I think I noticed it in past verions, but recently needed to do this again several times while throwing together some quick and dirty mock data and am seeing the same behavior at exatly 1000 cursors.

  • VSCode Version: 1.11.1 (d9484d1 2017-04-06T13:57:52.556Z)
  • OS Version: OS X El Cap 10.11.6

Steps to Reproduce:

Open a file like...
https://gist.githubusercontent.com/russgalloway/9345f5365bb5101d3c81c4902922c5d9/raw/f1787e73cbab7d4cef2726aa1da8fa0cf4dea6e4/vscode-multicursor-1000-cursors-issue-sample-data.json
...that has something you can match with (to repro this exactly) 1000 cursors.

Say, for instance, I wanted to update all the JSON objects in an array all at once by replacing key with id ...

  1. Place your cursor inside one of the "key" strings, press CMD+D to select the whole word key
  2. Press CMD+F to search the current document
  3. Press ALT+ENTER to select all instances of key
  4. Cursor to the beginning of key, hold SHIFT and cursor right 3 times to select all characters in all instances of key
  5. Type i then d

At first all instances of key are changed to i, but the first cursor is removed, leaving 999 cursors remaining with all the is that were typed selected
When d is typed, the lower 999 is are changed to d

Since the first cursor was removed leaving 999, you can continue to type without a problem.

@PunchyRascal
Copy link

PunchyRascal commented Jul 12, 2017

I am not sure if my problem is related, but a very similar issue exists with regular serach&replace (Ctrl+H) when combined with regular expression matching.

  • 'replace all' doesn't do anything
  • 'single replace' replaces an occurrence not highlighted by the search (first 1000 occurrences)

@ToMakeSense
Copy link

ToMakeSense commented Aug 10, 2017

#496 this bug really exists in a long period. Hope can be fixed soon.

@Mischala
Copy link

Mischala commented Aug 30, 2017

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'm currently at work, but when I get home i'll play with this constant.
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.

Edit: Also, it appears that the Find All Occurrences action is leveraginig the findMatches method, as opposed to the more through findAllMatches, this may be worth investigating also.

@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
*duplicate Issue identified as a duplicate of another issue(s) editor-core Editor basic functionality editor-multicursor Editor multiple cursor issues feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants