-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Decrement line ends if they end with a carriage return. #31220
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
Decrement line ends if they end with a carriage return. #31220
Conversation
We need test for this |
I suppose I could write a test to make sure we don't consume the |
A few things were discussed offline:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of my suggestions apply to parts of the code that you didn't touch, but I think this is a good opportunity to clean it up (and add test coverage).
7923588
to
2c90bda
Compare
@sheetalkamat I added a couple of tests. Do we have any concerns about how this could affect VSCode? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but get @sheetalkamat's signoff for interactions with VS Code -- or manually test on VS Code.
Attempting to enter a newline after the
#name
banner in the collapsed region depicted below causes a crash in Visual Studio.//#name
Previously the carriage return character
\r
was being included in the outlining span, as line ends here are determined only by the presence of the new line character\n
.This change simply decrements the line end by one if the line ends with a carriage return
\r
.Fixes JS region collapse area after carriage return.