line numbers are 1-based
This commit is contained in:
parent
cb8d415f87
commit
935859b60e
2 changed files with 3 additions and 3 deletions
|
|
@ -496,11 +496,11 @@ ace.Editor.prototype.moveCursorToPosition = function(pos) {
|
||||||
|
|
||||||
ace.Editor.prototype.gotoLine = function(lineNumber) {
|
ace.Editor.prototype.gotoLine = function(lineNumber) {
|
||||||
this._blockScrolling = true;
|
this._blockScrolling = true;
|
||||||
this.moveCursorTo(lineNumber, 0);
|
this.moveCursorTo(lineNumber-1, 0);
|
||||||
this._blockScrolling = false;
|
this._blockScrolling = false;
|
||||||
|
|
||||||
if (!this.isRowVisible(this.getCursorPosition().row)) {
|
if (!this.isRowVisible(this.getCursorPosition().row)) {
|
||||||
this.scrollToRow(lineNumber - Math.floor(this.getVisibleRowCount() / 2));
|
this.scrollToRow(lineNumber - 1 - Math.floor(this.getVisibleRowCount() / 2));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ ace.GutterLayer.prototype.update = function(config) {
|
||||||
var html = [];
|
var html = [];
|
||||||
for ( var i = config.firstRow; i <= config.lastRow; i++) {
|
for ( var i = config.firstRow; i <= config.lastRow; i++) {
|
||||||
html.push("<div class='gutter-cell' style='height:" + config.lineHeight
|
html.push("<div class='gutter-cell' style='height:" + config.lineHeight
|
||||||
+ "px;'>", i, "</div>");
|
+ "px;'>", (i+1), "</div>");
|
||||||
html.push("</div>");
|
html.push("</div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue