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

bug with comment // * #2

Closed
huiitre opened this issue Nov 29, 2023 · 9 comments
Closed

bug with comment // * #2

huiitre opened this issue Nov 29, 2023 · 9 comments

Comments

@huiitre
Copy link

huiitre commented Nov 29, 2023

Hello, i send a bug with this ext.
When i have a comment //* bad comment, solved by // * good comment (with space).

Solved totaly when i desactivate ext Better Comments (with embedded languages support).

Better Comments v3.0.2 by Aaron Bond dont have this problem

@edwinhuish
Copy link
Owner

Which version are you using?

I was change the reg for match only one space in v3.0.7, and matched also without space in v3.0.9

The latest version should not have this issue.

@jonathonmckay
Copy link

I'm having a similar problem with multi-line comments in Python.
If the comment starts like """Some Text (No white space), the comment is not detected, and code further down may end up being shown as a comment.
If the comment starts like """ Some Text (With a space or new line), the comment is detected correctly.
Using Better Comments Next v3.0.10

@edwinhuish
Copy link
Owner

edwinhuish commented Dec 1, 2023

I think it's a bad idea to match without space. It will cause wrong coloring.

I'm thinking also disable the single line comment match with no space.

Example:

For most language, // is single comment, but the below will cause wrong strikethrough

/////////////////////  DIVIDING LINE /////////////////////

For stata

********** It should be a normal comment ***********

@edwinhuish
Copy link
Owner

Updated with 8bb3468

@boromyr
Copy link

boromyr commented Dec 23, 2023

I have this problem with 3.1.8 too: if there is no space between the comment and the tag, the comment is not highlighted.
;! doesn't work but ; ! does

@edwinhuish
Copy link
Owner

edwinhuish commented Dec 24, 2023

I have this problem with 3.1.8 too: if there is no space between the comment and the tag, the comment is not highlighted. ;! doesn't work but ; ! does

better-comment-next now only match with ; ! (with one space) to avoid incorrect match.

For example:
aaron-bond#393
aaron-bond#501
aaron-bond#514

@xp-dv
Copy link

xp-dv commented Sep 13, 2024

As discussed in aaron-bond#531 (comment), this is not much of a solution to the problems with the original better-comments. Is it not possible to just create tag exceptions/better tag customization or at least the ability to have a choice in the extension settings?

@lonix1
Copy link

lonix1 commented Dec 4, 2024

Ignoring a comment with a space - e.g. ; ! - prevents people from using this extension, as it breaks existing code.

For people to move from the old to this extension, it should be compatible with the old one. If breaking changes are made, there should be a setting to enable/disable that new feature.

Nonetheless, I do appreciate that you forked the old extension and continue to maintain it.

@edwinhuish
Copy link
Owner

The old version's writing style can lead to a large number of recognition errors, compatibility with it is meaningless.
All you need to do is add a leading space uniformly, so that even if you switch back and forth between new and old versions, it can still be recognized normally.
Finally, even if you don't make any modifications, the impact will only be a lack of highlighting, and it won't cause any harm to your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants