Skip to content

Commit

Permalink
#275 Backtrack to the beginning of multiline strings/comments for fol…
Browse files Browse the repository at this point in the history
…ding
  • Loading branch information
techee authored and nyamatongwe committed Sep 13, 2024
1 parent 3ace72f commit 5cfd04a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ <h3>
</li>
<li>
Lexer added for Dart "dart".
<a href="https://github.com/ScintillaOrg/lexilla/pull/265">Pull request #265</a>.
<a href="https://github.com/ScintillaOrg/lexilla/pull/265">Pull request #265</a>,
<a href="https://github.com/ScintillaOrg/lexilla/pull/275">Pull request #275</a>.
</li>
<li>
Lexer added for troff / nroff "troff".
Expand Down
9 changes: 9 additions & 0 deletions lexers/LexDart.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,15 @@ void LexerDart::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty
Accessor styler(pAccess, nullptr);
const Sci_PositionU endPos = startPos + lengthDoc;
Sci_Position lineCurrent = styler.GetLine(startPos);
while (lineCurrent > 0) {
lineCurrent--;
startPos = styler.LineStart(lineCurrent);
initStyle = (startPos > 0) ? styler.StyleIndexAt(startPos) : 0;
if (initStyle != SCE_DART_COMMENTBLOCKDOC && initStyle != SCE_DART_COMMENTBLOCK &&
initStyle != SCE_DART_TRIPLE_RAWSTRING_SQ && initStyle != SCE_DART_TRIPLE_RAWSTRING_DQ &&
initStyle != SCE_DART_TRIPLE_STRING_SQ && initStyle != SCE_DART_TRIPLE_STRING_DQ)
break;
}
FoldLineState foldPrev(0);
int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0) {
Expand Down
2 changes: 0 additions & 2 deletions test/examples/dart/SciTE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ keywords3.*.dart=fBigInt Comparable Comparator Completer DateTime Deprecated \
SocketException SplayTreeMap SplayTreeSet StackTrace Stopwatch Stream String \
StringBuffer StringSink Symbol SystemHash Timer Type Uri UriData WeakReference
keywords4.*.dart=Spacecraft

testlexers.per.line.disable=1

0 comments on commit 5cfd04a

Please sign in to comment.