Skip to content

Commit

Permalink
Fix for "Toggle Single Line Comment" malfunctioning with HTML/XML
Browse files Browse the repository at this point in the history
Add space for a null character so last line character does not get cut off, and thus allow closing tag to be matched properly.

Fix notepad-plus-plus#3869, close notepad-plus-plus#3870
  • Loading branch information
CookiePLMonster authored and donho committed Feb 25, 2018
1 parent 34aec67 commit d3a8ab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3985,7 +3985,7 @@ bool Notepad_plus::doBlockComment(comment_mode currCommentMode)
//The NORMAL MODE is used for all Lexers which have a commentLineSymbol defined.
//The ADVANCED MODE is only available for Lexers which do not have a commentLineSymbol but commentStreamSymbols (start/end) defined.
//The ADVANCED MODE behaves the same way as the NORMAL MODE (comment/uncomment every single line in the selection range separately)
//but uses two smbols to accomplish this.
//but uses two symbols to accomplish this.
bool isSingleLineAdvancedMode = false;

if (buf->getLangType() == L_USER)
Expand Down Expand Up @@ -4107,7 +4107,7 @@ bool Notepad_plus::doBlockComment(comment_mode currCommentMode)
if (avoidIndent)
lineIndent = lineStart;

size_t linebufferSize = lineEnd - lineIndent + comment_length;
size_t linebufferSize = lineEnd - lineIndent + 1;
TCHAR* linebuf = new TCHAR[linebufferSize];

_pEditView->getGenericText(linebuf, linebufferSize, lineIndent, lineEnd);
Expand Down

0 comments on commit d3a8ab3

Please sign in to comment.