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
C++: Comments not always highlighted correctly #381
Comments
Could you please try it with Many thanks in advance! |
I cant also confirm this. It also happens with gedit though... |
Not good news, as this means gedit never got a commit to fix this we could backport |
Maybe this has got something to do with gtksourceview that handles the syntax highlighting? |
Yes, highlighting is done by GtkSourceView, we can't fix it here. |
I think I just found the fix for this by accident while trying to build gedit: build Pluma against gtksourceview-4 instead of gtksourceview-3. All it takes is two lines changes in configure.ac, and I got this result: EDIT: this works with current gtksourceview-3 as well, whatever fixed it was backported |
Unfortunately, using gtksourceview-4 breaks the external-tools plugin, giving these errors:
So we need some work there before we can switch over to the currently maintained branch of GtkSourceView |
On still further testing, I found that whatever change had been made to gtksourceview-4 had been backported to gtksourceview-3 , so this issue is now FIXED at least on Debian Unstable. This is true whether or not gtksourceview-4 is even installed, so I can confirm GNOME devs have fixed the problem. @Friedrich2 ? can you retest this and see if you are still having this problem? If not we can close this, if so your distro may not have caught up yet. |
You need to write something like |
OK, I just confirmed that the full |
Expected behaviour
C++ comments with // should be ended by the next newline character. (Source: [http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4640.pdf](a draft (page 23 / 37 of 1589, section 2.7)) Thus, pluma, should highlight all characters between the character sequence // (outside of strings!) and \n in the same colour.
Actual behaviour
pluma does not do this, if the comment contains a ">" sign (I think that it might have been a "<", but only one of the two characters). The coment seems to be ended by this character.
Steps to reproduce the behaviour
The first "test" word should erroneously have another colour than the second.
MATE general version
Unknown. It was the PC of a friend, with at least one ubuntu core update awaiting installation. Since it was not my PC, I am not able to test it for myself. A (rather short) naive testing seemed to show that the problem is independent of the previous #include<...> directive and of other characters in the comment section.
I did not test /* ... */ comments.
I hope that even these tiny pieces of information are sufficient to reproduce this error.
Package version
Unknown.
Linux Distribution
Link to downstream report of your Distribution
The text was updated successfully, but these errors were encountered: