-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Can't match multiline occurrences #10588
Comments
What is the expected result for lines with different indentation?
If the first two lines are selected, should "foo\n bar" also be selected? |
@ahmetalpbalkan 👍 for idea Some questions about possible implementation:
@StrongRef : i would expect to match only if the number of spaces is the same. Using regex would work for other scenarios. |
This has been implemented already. ctrl+D / cmd+D will work for multiline selections. |
@alexandrudima I'm not sure how ctrl+D is going to help. |
Interestingly, this works when seeding the find input via Perhaps the find input dom node needs some multiline property set, or turned into a textarea. More work would be needed to make it auto-grow in height based on the number of lines it contains. |
@hun1ahpu Also, the op does not clearly state what the specific problem is, i.e. it is left for interpretation what matching multiline occurences means. To me, it means @ahmetalpbalkan What exactly do you mean? |
@alexandrudima I think he means just by highlighting. |
Sorry for the latency here. I mean when I select multiline text, I should be able to ctrl+D to select other occurrences of the multiline text and be able to modify them together. You can see the Sublime Text for the desired behavior. |
I also want highlight when I select multiline (as @Anujan commented). Can I try fixing this? |
I took a look at the source code Update: on second look at code, the multiline highlight seems to be removed intentionally. This looks like a tricky one. |
The issue name should be updated to something like "Permit selectionHighlight for multiple lines", as it's hard to search for at the moment. It does currently appear to be explicitly disabled (for no stated reason): vscode/src/vs/editor/contrib/wordHighlighter/wordHighlighter.ts Lines 320 to 324 in 9089a79
(Perhaps for performance reasons?) It seems reasonable to up the line limit, make it configurable, or add a setting that enables multi-line selection highlighting. With regards to how the feature should work, I think leading whitespace on each consecutive line should be ignored, to avoid false negatives with different indentations. |
Is it possible to add an option in setting to toggle multi-line selection? |
Steps to Reproduce:
In the image below you can see that the highlighted text actually appears 3 times but it can't match it once the highlighted part spans multiple lines.
SublimeText works fine in this situation.
in case it helps, the file is here
The text was updated successfully, but these errors were encountered: