Skip to content

Commit f3839a6

Browse files
committed
Hack to make setLineClass faster when the line already has the given class
1 parent 3bf60c7 commit f3839a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/codemirror.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,10 @@ var CodeMirror = (function() {
10261026
var no = indexOf(lines, line);
10271027
if (no == -1) return null;
10281028
}
1029-
line.className = className;
1030-
changes.push({from: no, to: no + 1});
1029+
if (line.className != className) {
1030+
line.className = className;
1031+
changes.push({from: no, to: no + 1});
1032+
}
10311033
return line;
10321034
}
10331035

0 commit comments

Comments
 (0)