Skip to content

Commit

Permalink
Add comment for GetFoldParent() change.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jan 18, 2024
1 parent b71af2f commit 4768422
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scintilla/src/PerLine.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ Scintilla::FoldLevel LineLevels::GetFoldLevel(Sci::Line line) const noexcept {
Sci::Line LineLevels::GetFoldParent(Sci::Line line) const noexcept {
if (IsValidIndex(line, levels.Length())) {
const FoldLevel level = LevelNumberPart(GetFoldLevel(line));
if (level == FoldLevel::Base) {
// optimized for current block highlighting to avoid checking all previous lines,
// bug will occur for negative code folding level,
// see https://sourceforge.net/p/scintilla/feature-requests/1444/
// and https://github.com/ScintillaOrg/lexilla/issues/224
if (level <= FoldLevel::Base) {
return -1;
}
for (Sci::Line lineLook = line - 1; lineLook >= 0; lineLook--) {
Expand Down

0 comments on commit 4768422

Please sign in to comment.