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

Searching for text that spans across multiple lines #40726

Closed
HunderlineK opened this issue Dec 22, 2017 · 2 comments
Closed

Searching for text that spans across multiple lines #40726

HunderlineK opened this issue Dec 22, 2017 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@HunderlineK
Copy link

HunderlineK commented Dec 22, 2017

  • VSCode Version: 1.19.1
  • OS Version: Windows 10 Pro 64-bit Build 16299

Steps to Reproduce:

  1. Add a text (string) that spans across multiple lines
`This is a text that
spans multiple lines`
  1. Search for a sub string that spans across multiple lines, e.g. that spans. The editor cannot find the text. This is useful for cases where you are searching for a hardcoded text in your codebase (a footnote, tooltip, etc.)
@weinand
Copy link
Contributor

weinand commented Dec 22, 2017

In other text editors searching for "that spans" would not find anything either.
But there doing a regexp search with "that\sspans" works.

@alexdima
Copy link
Member

alexdima commented Jan 8, 2018

The OP issue, searching for that spans correctly yields no results.


Now, the curious case of that\sspans + regex mode:

Currently, \n must be present explicitly in the search text for our multi-line search mode to kick in.

The fact that a single \s in the search text doesn't bring the search in multiline mode is a duplicate of #9051 . The root cause is that we go into multiline search (where we create a large concatenated string of the entire buffer) only if there is sufficient evidence that the search query is multiline. We don't consider \s as sufficient evidence at this point.

@alexdima alexdima closed this as completed Jan 8, 2018
@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label Jan 8, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 22, 2018
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)
Projects
None yet
Development

No branches or pull requests

3 participants