| Index: Source/devtools/front_end/SourceFrame.js
|
| diff --git a/Source/devtools/front_end/SourceFrame.js b/Source/devtools/front_end/SourceFrame.js
|
| index 03f73d4a75011fa448add1d5bcd04190ab83fd76..74d76dadf10a04f88f9025c4856c004cd3292d0d 100644
|
| --- a/Source/devtools/front_end/SourceFrame.js
|
| +++ b/Source/devtools/front_end/SourceFrame.js
|
| @@ -125,8 +125,7 @@ WebInspector.SourceFrame.prototype = {
|
| {
|
| WebInspector.View.prototype.willHide.call(this);
|
|
|
| - this._clearPositionHighlight();
|
| - this._clearLineToReveal();
|
| + this._clearPositionToReveal();
|
| },
|
|
|
| /**
|
| @@ -213,56 +212,38 @@ WebInspector.SourceFrame.prototype = {
|
| */
|
| highlightPosition: function(line, column)
|
| {
|
| - this._clearLineToReveal();
|
| - this._clearLineToScrollTo();
|
| - this._clearSelectionToSet();
|
| - this._positionToHighlight = { line: line, column: column };
|
| - this._innerHighlightPositionIfNeeded();
|
| - },
|
| -
|
| - _innerHighlightPositionIfNeeded: function()
|
| - {
|
| - if (!this._positionToHighlight)
|
| - return;
|
| -
|
| - if (!this.loaded || !this._isEditorShowing())
|
| - return;
|
| -
|
| - this._textEditor.highlightPosition(this._positionToHighlight.line, this._positionToHighlight.column);
|
| - delete this._positionToHighlight;
|
| - },
|
| -
|
| - _clearPositionHighlight: function()
|
| - {
|
| - this._textEditor.clearPositionHighlight();
|
| - delete this._positionToHighlight;
|
| + this.revealPosition(line, column, true);
|
| },
|
|
|
| /**
|
| * @param {number} line
|
| + * @param {number=} column
|
| + * @param {boolean=} shouldHighlight
|
| */
|
| - revealLine: function(line)
|
| + revealPosition: function(line, column, shouldHighlight)
|
| {
|
| - this._clearPositionHighlight();
|
| this._clearLineToScrollTo();
|
| this._clearSelectionToSet();
|
| - this._lineToReveal = line;
|
| - this._innerRevealLineIfNeeded();
|
| + this._positionToReveal = { line: line, column: column, shouldHighlight: shouldHighlight };
|
| + this._innerRevealPositionIfNeeded();
|
| },
|
|
|
| - _innerRevealLineIfNeeded: function()
|
| + _innerRevealPositionIfNeeded: function()
|
| {
|
| - if (typeof this._lineToReveal === "number") {
|
| - if (this.loaded && this._isEditorShowing()) {
|
| - this._textEditor.revealLine(this._lineToReveal);
|
| - delete this._lineToReveal;
|
| - }
|
| - }
|
| + if (!this._positionToReveal)
|
| + return;
|
| +
|
| + if (!this.loaded || !this._isEditorShowing())
|
| + return;
|
| +
|
| + this._textEditor.revealPosition(this._positionToReveal.line, this._positionToReveal.column, this._positionToReveal.shouldHighlight);
|
| + delete this._positionToReveal;
|
| },
|
|
|
| - _clearLineToReveal: function()
|
| + _clearPositionToReveal: function()
|
| {
|
| - delete this._lineToReveal;
|
| + this._textEditor.clearPositionHighlight();
|
| + delete this._positionToReveal;
|
| },
|
|
|
| /**
|
| @@ -270,8 +251,7 @@ WebInspector.SourceFrame.prototype = {
|
| */
|
| scrollToLine: function(line)
|
| {
|
| - this._clearPositionHighlight();
|
| - this._clearLineToReveal();
|
| + this._clearPositionToReveal();
|
| this._lineToScrollTo = line;
|
| this._innerScrollToLineIfNeeded();
|
| },
|
| @@ -323,8 +303,7 @@ WebInspector.SourceFrame.prototype = {
|
|
|
| _wasShownOrLoaded: function()
|
| {
|
| - this._innerHighlightPositionIfNeeded();
|
| - this._innerRevealLineIfNeeded();
|
| + this._innerRevealPositionIfNeeded();
|
| this._innerSetSelectionIfNeeded();
|
| this._innerScrollToLineIfNeeded();
|
| },
|
|
|