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

Ignore specific different comment pattern (but not the whole line) #2670

Open
Bainion opened this issue Mar 10, 2025 · 3 comments
Open

Ignore specific different comment pattern (but not the whole line) #2670

Bainion opened this issue Mar 10, 2025 · 3 comments

Comments

@Bainion
Copy link

Bainion commented Mar 10, 2025

I'm want to compare some instruction files for CNC that don't have the same comment pattern as the default IgnoreComment plugin. In my case comment are between parenthesis.

Could it be possible to add a way to ignore part of lines following a pattern. Maybe that the IgnoreComment can have configurable comment boundaries where we can set start and end of comment symbols.

This could also be useful for some other languages/type of files with different comment pattern.

@sdottaka
Copy link
Member

Adding a Substitution filter that replaces comments with empty strings as shown below may get you the results you expect.

Image

Image

\([^()]*\) 

@Bainion
Copy link
Author

Bainion commented Mar 11, 2025

Thanks but unfortunately it doesn't work.
First it only works for lines that are only composed of a comment. If there is code and a comment it doesn't ignore the comment part. Even with the full comment lines it does not work constitantly. Some are ignored but for other it is still considered as a code difference.
There doesn't seem to be any rhyme or reason as to why some lines are recognized or not.

@sdottaka
Copy link
Member

Do you mean it doesn't work if the code and comments are different on both sides of the same line? I think it would work if the code matches but the comments are different. This is a limitation of the current WinMerge functionality. If it doesn't work when the code matches but the comments are different, could you please attach a file that shows the problem?

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

2 participants