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

Multi-line comment detected within single line comment (c++). #52

Closed
marcel303 opened this issue Oct 18, 2018 · 2 comments
Closed

Multi-line comment detected within single line comment (c++). #52

marcel303 opened this issue Oct 18, 2018 · 2 comments
Labels

Comments

@marcel303
Copy link
Contributor

marcel303 commented Oct 18, 2018

Hi,

The following code has incorrect syntax highlighting. One can verify this by copy-pasting it into the editor.

	if (hasValue == false && nodeId != kGraphNodeIdInvalid)
	{
		//logDebug("reset realTimeSocketCapture");
		//*this = GraphEdit_Visualizer();
	}
	
	//
	
	const bool hasChannels = channelData.hasChannels();
	
	if (hasChannels)
	{

I investigated why, and it's caused by the multi-line comment highlighter running before single line comments are detected. It causes the '/*' in '//*this' above to be interpreted as the start of a multi-line comment. While it should be ignored as it's part of a single line comment. A possible solution would be to detect single line comments together with multi-line ones.

Perhaps eventually to make (multi-line) comments work well across different languages we'll need a separate comment highlighter for each language.

@marcel303 marcel303 changed the title Multi-line comment detected within single line comment. Multi-line comment detected within single line comment (c++). Oct 18, 2018
@BalazsJako BalazsJako added the bug label Dec 8, 2018
BalazsJako added a commit that referenced this issue Dec 8, 2018
…ding \ handling.

Better preprocessor coloring: it will use interpolated value between the preprocessor color and the token color, so strings, preprocessor identifiers, numbers, etc. are still distinguishable.
@BalazsJako
Copy link
Owner

Fixed in 8fbb932.

@marcel303
Copy link
Contributor Author

Thanks, seems to work well!

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

No branches or pull requests

2 participants