line numbers are 1-based

This commit is contained in:
Fabian Jakobs 2010-04-19 17:47:23 +02:00
commit 935859b60e
2 changed files with 3 additions and 3 deletions

View file

@ -496,11 +496,11 @@ ace.Editor.prototype.moveCursorToPosition = function(pos) {
ace.Editor.prototype.gotoLine = function(lineNumber) {
this._blockScrolling = true;
this.moveCursorTo(lineNumber, 0);
this.moveCursorTo(lineNumber-1, 0);
this._blockScrolling = false;
if (!this.isRowVisible(this.getCursorPosition().row)) {
this.scrollToRow(lineNumber - Math.floor(this.getVisibleRowCount() / 2));
this.scrollToRow(lineNumber - 1 - Math.floor(this.getVisibleRowCount() / 2));
}
},

View file

@ -10,7 +10,7 @@ ace.GutterLayer.prototype.update = function(config) {
var html = [];
for ( var i = config.firstRow; i <= config.lastRow; i++) {
html.push("<div class='gutter-cell' style='height:" + config.lineHeight
+ "px;'>", i, "</div>");
+ "px;'>", (i+1), "</div>");
html.push("</div>");
}