Skip to content

Commit 6095fbf

Browse files
committed
Fix lineAtHeight when asking past end, but last line is collapsed
1 parent 3f69529 commit 6095fbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/codemirror.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,7 @@ window.CodeMirror = (function() {
30633063
else if (line > last) { line = last; end = true; }
30643064
var lineObj = getLine(this.doc, line);
30653065
return intoCoordSystem(this, getLine(this.doc, line), {top: 0, left: 0}, mode || "page").top +
3066-
(end ? lineObj.height : 0);
3066+
(end ? this.doc.height - heightAtLine(this, lineObj) : 0);
30673067
},
30683068

30693069
defaultTextHeight: function() { return textHeight(this.display); },

0 commit comments

Comments
 (0)