Fixed failing unit test by implementing MockRenderer#scrollToLine
This commit is contained in:
parent
e9049b239a
commit
d7539ff362
1 changed files with 11 additions and 1 deletions
|
|
@ -94,7 +94,17 @@ MockRenderer.prototype.updateCursor = function(position) {
|
|||
this.cursor.column = position.column;
|
||||
};
|
||||
|
||||
MockRenderer.prototype.scrollToLine = function(row) {
|
||||
MockRenderer.prototype.scrollToLine = function(line, center) {
|
||||
var lineHeight = { lineHeight: 16 };
|
||||
var row = 0;
|
||||
for (var l = 1; l < line; l++) {
|
||||
row += this.session.getRowHeight(lineHeight, l-1) / lineHeight.lineHeight;
|
||||
}
|
||||
|
||||
if (center) {
|
||||
row -= this.visibleRowCount / 2;
|
||||
}
|
||||
this.scrollToRow(row);
|
||||
};
|
||||
|
||||
MockRenderer.prototype.scrollCursorIntoView = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue