diff --git a/src/app.js b/src/app.js index d00ddd4db8..32b0eab86e 100644 --- a/src/app.js +++ b/src/app.js @@ -753,6 +753,8 @@ var run = function () { switchToFile(source) } this.statementMarker = editor.addMarker(lineColumnPos, 'highlightcode') + editor.scrollToLine(lineColumnPos.start.line, true, true, function () {}) + if (lineColumnPos.start.line === lineColumnPos.end.line) { this.fullLineMarker = editor.addMarker({ start: { diff --git a/src/app/editor.js b/src/app/editor.js index 727cbdc21a..5be14bbcc0 100644 --- a/src/app/editor.js +++ b/src/app/editor.js @@ -152,6 +152,10 @@ function Editor (editorElement) { return editor.session.addMarker(currentRange, cssClass) } + this.scrollToLine = function (line, center, animate, callback) { + editor.scrollToLine(line, center, animate, callback) + } + this.removeMarker = function (markerId) { editor.session.removeMarker(markerId) }