Skip to content

Commit

Permalink
Fix WebAssembly nested comment highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Aug 16, 2023
1 parent 31dc208 commit f3d0372
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scintilla/lexers/LexBash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle
}
break;
case SCE_SH_IDENTIFIER:
if (sc.chPrev == '\\' || !IsBashWordChar(sc.ch, cmdState)) {
if (!IsBashWordChar(sc.ch, cmdState)) {
sc.SetState(SCE_SH_DEFAULT);
}
break;
Expand Down
4 changes: 2 additions & 2 deletions scintilla/lexers/LexWASM.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void ColouriseWASMDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
1: lineStateLineComment
8: commentLevel
*/
commentLevel = (lineState >> 1) & 0xff;
commentLevel = lineState >> 1;
}

while (sc.More()) {
Expand Down Expand Up @@ -192,7 +192,7 @@ void ColouriseWASMDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
++visibleChars;
}
if (sc.atLineEnd) {
const int lineState = commentLevel | lineStateLineComment;
const int lineState = (commentLevel << 1) | lineStateLineComment;
styler.SetLineState(sc.currentLine, lineState);
visibleChars = 0;
lineStateLineComment = 0;
Expand Down

0 comments on commit f3d0372

Please sign in to comment.