Skip to content

Commit

Permalink
[Dart] Fix simple string interpolation highlighting, issue #806.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Aug 18, 2024
1 parent 97f0530 commit 942bb0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions scintilla/lexers/LexDart.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,15 @@ void ColouriseDartDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
} else {
char s[128];
sc.GetCurrent(s, sizeof(s));
const int state = sc.state;
if (keywordLists[KeywordIndex_Keyword].InList(s)) {
const bool keyword = keywordLists[KeywordIndex_Keyword].InList(s);
if (sc.state == SCE_DART_IDENTIFIER_NODOLLAR) {
if (keyword) { // built-in identifier or this
sc.ChangeState(SCE_DART_WORD);
}
sc.SetState(escSeq.outerState);
continue;
}
if (keyword) {
sc.ChangeState(SCE_DART_WORD);
if (StrEqualsAny(s, "import", "part")) {
if (visibleChars == sc.LengthCurrent()) {
Expand Down Expand Up @@ -238,10 +245,6 @@ void ColouriseDartDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
if (sc.state != SCE_DART_WORD && sc.ch != '.') {
kwType = KeywordType::None;
}
if (state == SCE_DART_IDENTIFIER_NODOLLAR) {
sc.SetState(escSeq.outerState);
continue;
}
}

sc.SetState(SCE_DART_DEFAULT);
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexers/LexFortran.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void ColouriseFortranDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int ini
kwType = KeywordType::Function;
} else if (state == SCE_F_FOLDING_WORD) {
if (StrEqual(s, "if")) {
state = SCE_F_WORD;
state = SCE_F_WORD;
ifConstruct = prevWord != KeywordType::Else;
} else if (StrEqual(s, "type")) {
if (chNext == '(' || prevWord == KeywordType::Select) {
Expand Down

0 comments on commit 942bb0e

Please sign in to comment.