-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Fix folding in user-defined languages for non-windows line endings #3372
Conversation
Update: I realized that the previous fix was only for operators (like semicolon in C), I've now fixed it so that delimiters (like quotes) don't break the folding either. |
I'm so glad to see a fix for this! It's been bugging me for years. We even keep a bunch of files in Windows EOL format just so code folding works with our UDL. Otherwise they should be Unix EOL format. I managed to compile Notepad++ with your changes and it works great, just like it should. Hope to see this fix in a released version soon. Thanks again! |
@ivan-radic Could you validate this PR please? |
Thanks for notification @donho and thanks to @ssk97 for the fix. Anyway, looking at the code variable checkEOL is used to force EOL processing when Delimiter close statement "consumes" EOL. Typical example are line comments, EOL is consumed by line comment (or delimiter that is closed by ((EOL)) special character). Of top of my head, I don't remember why was it necessary to skip EOL processing if Delimiter open and Folding keywords that are immediately followed by EOL char, but it obviously is missing for Opetaror1 stye. Thanks @ssk97 for finding that bug. First commit should be merged into main branch. As for second commit, it is not good: ` - if (sc.atLineStart) EOL at the end of line comments is not "skipped forward" because of potential nested line comment sequence. Therefore, we can't check atLineEnd but must instead rely on atLineStart which is safe even in case of multiple nested line comments. |
Long story short: use first commit, discard second one. Some basic testing in pre-release phase by beta testers would be wise. Best regards, |
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.
The changes resolve the problem. Folding works well with all types of EOL (CRLF, LF, CR).
Still not work when using "SCE_USER_STYLE_COMMENTLINE" & "SCE_USER_STYLE_DELIMITER" (1-8) Seem to work now! |
Can we have this at 7.6.6 please? |
Cherry pick |
fixes #2873 and fixes #350 (duplicate issues)
I also replaced two instances of "true" with EOL_SKIP_CHECK since that's what it evaluates to (and to reduce confusion since "true" would imply EOL_FORCE_CHECK)