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

Can't match multiline occurrences #10588

Closed
ahmetb opened this issue Aug 16, 2016 · 15 comments
Closed

Can't match multiline occurrences #10588

ahmetb opened this issue Aug 16, 2016 · 15 comments
Assignees
Labels
editor-find Editor find operations feature-request Request for new features or functionality

Comments

@ahmetb
Copy link

ahmetb commented Aug 16, 2016

  • VSCode Version: 1.4.0

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.

image

SublimeText works fine in this situation.

in case it helps, the file is here

        "master": {
            "publisher": "Microsoft.OSTCExtensions",
            "type": "CustomScriptForLinux",
            "typeHandlerVersion": "1.4",
        "autoUpgradeMinorVersion": true,
            "settings": {
              "fileUris": "[variables('centosScripts')]",
              "commandToExecute": "[concat('bash elasticsearch-centos-install.sh -xn ', variables('esSettings').clusterName, ' -v ', variables('esSettings').version, ' -d ', variables('esSettings').discoveryHosts, variables('marvelParamValue'), variables('jmeterParamValue'), variables('cloudAzureParamValue'), variables('marvelExportParamValue'), variables('afsParamValue'))]"
            }
          },
        "client": {
            "publisher": "Microsoft.OSTCExtensions",
            "type": "CustomScriptForLinux",
            "typeHandlerVersion": "1.4",
        "autoUpgradeMinorVersion": true,
            "settings": {
              "fileUris": "[variables('centosScripts')]",
              "commandToExecute": "[concat('bash elasticsearch-centos-install.sh -yn ', variables('esSettings').clusterName, ' -v ', variables('esSettings').version, ' -d ', variables('esSettings').discoveryHosts, variables('marvelParamValue'), variables('jmeterParamValue'),  variables('cloudAzureParamValue'),variables('marvelExportParamValue'), variables('afsParamValue'))]"
            }
          },
        "data": {
          "publisher": "Microsoft.OSTCExtensions",
          "type": "CustomScriptForLinux",
          "typeHandlerVersion": "1.4",
      "autoUpgradeMinorVersion": true,
          "settings": {
            "fileUris": "[variables('centosScripts')]",
            "commandToExecute": "[concat('bash elasticsearch-centos-install.sh -zn ', variables('esSettings').clusterName, ' -v ', variables('esSettings').version, ' -d ', variables('esSettings').discoveryHosts, variables('marvelParamValue'), variables('jmeterParamValue'),  variables('cloudAzureParamValue'),variables('marvelExportParamValue'), variables('afsParamValue'))]"
          }
        },
@alexdima alexdima self-assigned this Aug 17, 2016
@alexdima alexdima added feature-request Request for new features or functionality editor-contrib Editor collection of extras labels Aug 17, 2016
@alexdima alexdima added this to the Backlog milestone Aug 17, 2016
@alexdima alexdima added editor-find Editor find operations good first issue Issues identified as good for first-time contributors labels Aug 29, 2016
@alexdima alexdima removed their assignment Aug 29, 2016
@StrongRef
Copy link

What is the expected result for lines with different indentation?

foo
bar


foo
   bar

If the first two lines are selected, should "foo\n bar" also be selected?

@hun1ahpu
Copy link
Contributor

hun1ahpu commented Dec 11, 2016

@ahmetalpbalkan 👍 for idea

Some questions about possible implementation:

  • UI: having multiline textbox for search it might cover significant part of the screen, especially in Replace mode. Sublime has similar problem but as the search view is at the bottom of the page it's not that intrusive. Should we consider limiting the max height and having scroll?
  • Should it work the same way for In-Project search (ctrl+shift+F)?
  • How it will work in combination with a regex?
  • Don't know what the overall strategy for the product is but it won't be consistent with Visual Studio.

@StrongRef : i would expect to match only if the number of spaces is the same. Using regex would work for other scenarios.

@alexdima
Copy link
Member

This has been implemented already. ctrl+D / cmd+D will work for multiline selections.

@hun1ahpu
Copy link
Contributor

@alexandrudima I'm not sure how ctrl+D is going to help.
The problem in the issue is that you can't search for multi-line text (the text that spans over 2 or more consequent lines) without using regular expressions.
Ctrl+D if i understand correctly let's add next matching string into selection.

@alexdima
Copy link
Member

Interestingly, this works when seeding the find input via ctrl+d (programmatically), but does not work when pasting multiline text in the find input. Here I am doing ctrl+d followed by ctrl+f

10588

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.

@alexdima alexdima reopened this Dec 13, 2016
@alexdima
Copy link
Member

@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 ctrl+d, hence the label beginner and hence my closing the issue.

@ahmetalpbalkan What exactly do you mean?

@Anujan
Copy link

Anujan commented Dec 30, 2016

@alexandrudima I think he means just by highlighting.

vscode 10588

@ahmetb
Copy link
Author

ahmetb commented Dec 30, 2016

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.

@rebornix rebornix self-assigned this Apr 28, 2017
@mazamachi
Copy link
Contributor

I also want highlight when I select multiline (as @Anujan commented). Can I try fixing this?
As I am new to this repository, I would like to ask your comments about whether this feature is desirable.

@rebornix rebornix removed their assignment Sep 5, 2017
@prog-rajkamal
Copy link
Contributor

prog-rajkamal commented Oct 1, 2017

@mazamachi

I took a look at the source code and this looks like a simple fix. If you don't mind, I want to try to fix this issue.

Update: on second look at code, the multiline highlight seems to be removed intentionally. This looks like a tricky one.

@alexdima alexdima removed the good first issue Issues identified as good for first-time contributors label Oct 20, 2017
@alexdima alexdima removed editor-contrib Editor collection of extras editor labels Nov 23, 2017
@varkor
Copy link

varkor commented Sep 7, 2019

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):

// ignore multiline selection
if (editorSelection.startLineNumber !== editorSelection.endLineNumber) {
this._stopAll();
return;
}

(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.

@dnlw07
Copy link

dnlw07 commented Feb 19, 2020

Is it possible to add an option in setting to toggle multi-line selection?

@rebornix rebornix self-assigned this Nov 2, 2020
@rebornix rebornix modified the milestones: Backlog, Backlog Candidates Nov 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-find Editor find operations feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

11 participants