Skip to content

Commit

Permalink
Update special character list for Texinfo lexer.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Feb 25, 2023
1 parent 8b61d26 commit d8ef4cc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scintilla/lexers/LexTexinfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ using namespace Lexilla;

namespace {

constexpr bool IsTexiSpec(int ch) noexcept {
return ch == '@' || ch == '{' || ch == '}' ||
ch == '*' || ch == '/' || ch == '-' ||
ch == ':' || ch == '.' || ch == '?' || ch == '?' ||
ch == '\"' || ch == '\'' || ch == ',' || ch == '=' || ch == '~';
constexpr bool IsTexiSpecial(char ch) noexcept {
// https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Command-List.html
return AnyOf(ch,
' ', '\t', '\r', '\n',
'!', '\"', '\'', '&', '*', ',', '-', '.', '/', ':',
'=', '?', '@', '\\', '^', '`', '{', '}', '~'
);
}

#define MAX_WORD_LENGTH 31
Expand Down Expand Up @@ -131,7 +133,7 @@ void ColouriseTexiDoc(Sci_PositionU startPos, Sci_Position length, int initStyle
buf[0] = ch;
wordLen = 1;
} else if (ch == '@') {
if (IsTexiSpec(chNext)) {
if (IsTexiSpecial(chNext)) {
styler.ColorTo(i, state);
state = SCE_L_SPECIAL;
} else if (IsAlpha(chNext)) {
Expand Down

0 comments on commit d8ef4cc

Please sign in to comment.