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

Files using CRLF breaks shows as having no line breaks in Search Results in Editor #191347

Closed
falkonline opened this issue Aug 25, 2023 · 7 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster

Comments

@falkonline
Copy link

falkonline commented Aug 25, 2023

Does this issue occur when all extensions are disabled?: Yes

Version: 1.81.1 (user setup)
Commit: 6c3e3db
Date: 2023-08-09T22:22:42.175Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19044

If searching files and use Search Results to Editor with files with CRLF line breaks, The Results in Editor tab shows the entire file as on one line (no line breaks).

Particularly noticeable if using Regex $ or \n. The line breaks are not matched.

  • VS Code Version: 1.81.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. have file(s) with CRLF
  2. Go to Search mode (Control Shift F)
  3. Use Regex mode (alt-R)
  4. type in $
  5. Alt Enter to have Results to Editor
  6. No end of lines found
@Cnily03
Copy link

Cnily03 commented Aug 26, 2023

"xxxx\r\nxxx\r\n" won't match /$/. $ means end of the string, but not end of a line. And cannot using independently. You can try \r?\n when searching in regex mode.

@falkonline
Copy link
Author

Always used $ for end of line, but just looked it up and its 'engine dependent'.

Tried with \r?\n or even \n, and its doesn't find a match.

You can see in the attached screen shot, the search results tab seems to consider the file as all one line (some crude censoring by me).

vscode001

Even with Line Context at zero, the entire document is in the result. (test.txt, has regular line breaks, the M8N03268 is the demonstration).

@andreamah
Copy link
Contributor

I can't seem to reproduce the bug where it's all on one line. $ seems to be matching okay.
Recording 2023-08-28 at 12 53 00

@andreamah andreamah added the info-needed Issue requires more information from poster label Aug 28, 2023
@falkonline
Copy link
Author

Looks like a titled this incorrectly, I appears to be only for files that use a single 0D (CR) for line break. CRLF (0D0A) has no issue.

@andreamah
Copy link
Contributor

I believe that CR line endings aren't supported. See here: #35797

@falkonline
Copy link
Author

Would the best course to close this as duplicate?

@andreamah
Copy link
Contributor

Yes. /duplicate #35797

@VSCodeTriageBot VSCodeTriageBot added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2023
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) info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants