Skip to content

Commit

Permalink
Simplify code folding.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Dec 15, 2024
1 parent 27a6432 commit b4dc348
Show file tree
Hide file tree
Showing 42 changed files with 6 additions and 88 deletions.
2 changes: 0 additions & 2 deletions scintilla/lexers/LexAPDL.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ void FoldAPDLDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char buf[16];
constexpr int MaxFoldWordLength = sizeof(buf) - 1;
Expand Down Expand Up @@ -251,7 +250,6 @@ void FoldAPDLDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexAsm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ void FoldAsmDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L

int levelNext = levelCurrent;
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int style = initStyle;
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -490,7 +489,6 @@ void FoldAsmDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
chPrevNonWhite = '\0';
chBefore = '\0';
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexAsymptote.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ void FoldAsyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int styleNext = styler.StyleIndexAt(startPos);
int style = initStyle;
Expand Down Expand Up @@ -310,7 +309,6 @@ void FoldAsyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexAutoHotkey.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,6 @@ void FoldAHKDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L
int levelNext = levelCurrent;
int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int styleNext = styler.StyleIndexAt(startPos);
int style = initStyle;
Expand Down Expand Up @@ -833,7 +832,6 @@ void FoldAHKDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
lineCommentPrev = lineCommentCurrent;
lineCommentCurrent = lineCommentNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexAutoIt3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int /*initStyle*/,
levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
}
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
int levelNext = levelCurrent;
char chPrev = ' ';
while (startPos < endPos) {
Expand Down Expand Up @@ -732,7 +731,6 @@ void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int /*initStyle*/,
// reset values for the next line
lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
stylePrev = style;
style = styleNext;
levelCurrent = levelNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexAviSynth.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ void FoldAvsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L
int levelNext = levelCurrent;
int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char chNext = styler[startPos];
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -337,7 +336,6 @@ void FoldAvsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
lineCommentPrev = lineCommentCurrent;
lineCommentCurrent = lineCommentNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexAwk.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ void FoldAwkDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle*
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
int visibleChars = 0;

while (startPos < endPos) {
Expand Down Expand Up @@ -471,7 +470,6 @@ void FoldAwkDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initStyle*

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexBash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,6 @@ void FoldBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, Lex
const Sci_PositionU endPos = startPos + length;
Sci_Line lineCurrent = styler.GetLine(startPos);
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -1009,7 +1008,6 @@ void FoldBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, Lex
styler.SetLevel(lineCurrent, lev);
lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelPrev = levelCurrent;
}
}
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexCMake.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ void FoldCMakeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
int levelNext = levelCurrent;
int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int styleNext = styler.StyleIndexAt(startPos);
int style = initStyle;
Expand Down Expand Up @@ -412,7 +411,6 @@ void FoldCMakeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
lineCommentPrev = lineCommentCurrent;
lineCommentCurrent = lineCommentNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexCSV.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ void ColouriseCSVDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty
styler.StartSegment(startPos);
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
const Sci_PositionU endPos = startPos + lengthDoc;
lineStartNext = sci::min(lineStartNext, endPos);

uint8_t chPrev = 0;
uint8_t chPrevNonWhite = delimiter;
Expand Down Expand Up @@ -126,7 +125,6 @@ void ColouriseCSVDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty
styler.SetLineState(lineCurrent, lineState);
lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
}
}

Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexCSharp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@ void FoldCSharpDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char buf[12]; // endregion
constexpr int MaxFoldWordLength = sizeof(buf) - 1;
Expand Down Expand Up @@ -874,7 +873,6 @@ void FoldCSharpDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexCangjie.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ void FoldCangjieDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyl
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char chNext = styler[startPos];
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -503,7 +502,6 @@ void FoldCangjieDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyl

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexD.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ void FoldDDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Lex
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char chNext = styler[startPos];
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -739,7 +738,6 @@ void FoldDDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Lex

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexDart.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ void FoldDartDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char chNext = styler[startPos];
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -529,7 +528,6 @@ void FoldDartDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexFortran.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ void FoldFortranDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initSt
int levelNext = levelCurrent;
int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int style = SCE_F_DEFAULT;
while (startPos < endPos) {
Expand Down Expand Up @@ -402,7 +401,6 @@ void FoldFortranDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int /*initSt

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
lineCommentPrev = lineCommentCurrent;
lineCommentCurrent = lineCommentNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexGo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@ void FoldGoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le
int levelNext = levelCurrent;
int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int styleNext = styler.StyleIndexAt(startPos);
int style = initStyle;
Expand Down Expand Up @@ -623,7 +622,6 @@ void FoldGoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
lineCommentPrev = lineCommentCurrent;
lineCommentCurrent = lineCommentNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexGroovy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ void FoldGroovyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int styleNext = styler.StyleIndexAt(startPos);
int style = initStyle;
Expand Down Expand Up @@ -633,7 +632,6 @@ void FoldGroovyDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexHaxe.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ void FoldHaxeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char chNext = styler[startPos];
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -473,7 +472,6 @@ void FoldHaxeDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexInno.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ void FoldInnoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
int levelNext = levelCurrent;
int lineState = styler.GetLineState(lineCurrent);
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char buf[12]; // interface
constexpr int MaxFoldWordLength = sizeof(buf) - 1;
Expand Down Expand Up @@ -530,7 +529,6 @@ void FoldInnoDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
lineStatePrev = lineState;
lineState = lineStateNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexJSON.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void ColouriseJSONDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
assert(startPos == static_cast<Sci_PositionU>(styler.LineStart(lineCurrent)));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
const Sci_PositionU endPos = startPos + lengthDoc;
lineStartNext = sci::min(lineStartNext, endPos);

// see GenerateJsonCharClass() in scripts/GenerateCharTable.py
static constexpr uint8_t kJsonCharClass[256] = {
Expand Down Expand Up @@ -263,7 +262,6 @@ void ColouriseJSONDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
}
lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
}
}

Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexJam.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ void FoldJamDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int visibleChars = 0;
int style = initStyle;
Expand Down Expand Up @@ -316,7 +315,6 @@ void FoldJamDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, L

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexJava.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ void FoldJavaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

int styleNext = styler.StyleIndexAt(startPos);
int style = initStyle;
Expand Down Expand Up @@ -659,7 +658,6 @@ void FoldJavaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexJavaScript.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ void FoldJsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char chNext = styler[startPos];
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -694,7 +693,6 @@ void FoldJsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, Le

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexJulia.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ void FoldJuliaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,
int levelNext = levelCurrent;
int lineCommentCurrent = GetLineCommentState(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char buf[12]; // baremodule
constexpr int MaxFoldWordLength = sizeof(buf) - 1;
Expand Down Expand Up @@ -629,7 +628,6 @@ void FoldJuliaDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle,

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
lineCommentPrev = lineCommentCurrent;
lineCommentCurrent = lineCommentNext;
Expand Down
2 changes: 0 additions & 2 deletions scintilla/lexers/LexKotlin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ void FoldKotlinDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);

char chNext = styler[startPos];
int styleNext = styler.StyleIndexAt(startPos);
Expand Down Expand Up @@ -506,7 +505,6 @@ void FoldKotlinDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle

lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
Expand Down
Loading

0 comments on commit b4dc348

Please sign in to comment.