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

Regex for empty lines ending with \n should highlight only empty lines #13355

Closed
sandy081 opened this issue Oct 7, 2016 · 6 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-find Editor find operations verified Verification succeeded

Comments

@sandy081
Copy link
Member

sandy081 commented Oct 7, 2016

Steps to Reproduce:

  • Search for regex for empty line ^\s*$\n
  • Use Enter to navigate matches

Expected: Only empty lines should be highlighted
Actual: Empty line and its next line are getting highlighted

@sandy081 sandy081 added the editor-find Editor find operations label Oct 7, 2016
@sandy081 sandy081 added this to the October 2016 milestone Oct 7, 2016
@sandy081 sandy081 self-assigned this Oct 7, 2016
@sandy081 sandy081 added the bug Issue identified by VS Code Team member as probable bug label Oct 7, 2016
@Bill-Stewart
Copy link

Regex can be shortened to ^$\n - reproduced here also - should match empty line followed by a newline. However I am wondering what the use case is - why not just ^$ (why trailing newline)?

@sandy081 sandy081 removed the bug Issue identified by VS Code Team member as probable bug label Oct 11, 2016
@sandy081
Copy link
Member Author

sandy081 commented Oct 11, 2016

@Bill-Stewart I have the same question asked in #11572. For empty lines you just need ^\s*$ and do not need \n at the end of the reg ex. But I see some inconsistency between selected matches and line highlights when \n at the end. I will investigate why is this difference occurring.

Thanks

@Bill-Stewart
Copy link

I agree the behavior seems puzzling. It seems that the match should not include the end of non-empty lines.

@sandy081 sandy081 modified the milestones: November 2016, October 2016 Oct 26, 2016
@sandy081 sandy081 modified the milestones: Backlog, November 2016 Dec 7, 2016
@therealmarv
Copy link

@sandy081 this seems for me fixed on 1.9.0

@sandy081
Copy link
Member Author

sandy081 commented Feb 6, 2017

@therealmarv I still see it in insiders

kapture 2017-02-06 at 7 42 24

@therealmarv
Copy link

sorry! Thanks for the gif. I've first thought of marking instead of highlighting. So this is a pure cosmetic problem. btw. searching, editing (like removing) all this empty lines e.g. with multi cursor works.

@sandy081 sandy081 assigned alexdima and unassigned sandy081 Apr 7, 2017
@sandy081 sandy081 added the bug Issue identified by VS Code Team member as probable bug label Apr 7, 2017
@alexdima alexdima modified the milestones: Backlog, September 2017 Sep 27, 2017
@mjbvz mjbvz added the verified Verification succeeded label Sep 27, 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
bug Issue identified by VS Code Team member as probable bug editor-find Editor find operations verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants