-
Notifications
You must be signed in to change notification settings - Fork 590
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
Don't insert * after new line in multi-line comment if previous line … #3392
Conversation
…doesn't start with * Fixes geany#3386.
if (style == SCE_D_COMMENTNESTED) | ||
continuation = "+"; /* for nested comments in D */ | ||
|
||
else if (!(g_str_has_prefix(previous_line + i, continuation) && |
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.
I'd just suggest inverting the condition (i.e. removing the initial !
) and adding the 3 lines after this block inside the block. This way you avoid the duplicated g_free(previous_line);
and the extra return
.
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.
Apart from that the PR looks fine to me and is useful, I also did run into this issue in the past.
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.
That would break the first if clause before the else if on this line.
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.
Ah, right, sorry, I didn't think about that.
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.
No problem, thanks for reviewing.
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.
Looks good and works well 👍
…doesn't start with *
Fixes #3386.
Note: This was already the case when the previous line is blank, but a * was inserted when it is not blank.