Skip to content

Commit

Permalink
significant speed optimisation when large amount of lines are folded
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondf authored and marijnh committed Aug 14, 2019
1 parent dbc8832 commit 5b341e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions addon/fold/foldgutter.js
Expand Up @@ -51,8 +51,13 @@

function isFolded(cm, line) {
var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));
for (var i = 0; i < marks.length; ++i)
if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];
for (var i = 0; i < marks.length; ++i) {
if (marks[i].__isFold) {
var fromPos = marks[i].find(-1);
if (fromPos && fromPos.line === line)
return marks[i];
}
}
}

function marker(spec) {
Expand Down

0 comments on commit 5b341e1

Please sign in to comment.