Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1375)

Unified Diff: Source/devtools/front_end/CodeMirrorTextEditor.js

Issue 203433002: DevTools: Reuse _showSourceLocation for execution line changes handling in sources panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined and fixed highlighting after execution line changes Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/SourcesPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/CodeMirrorTextEditor.js
diff --git a/Source/devtools/front_end/CodeMirrorTextEditor.js b/Source/devtools/front_end/CodeMirrorTextEditor.js
index e6185b60ab71e0f00010d8f220feb6104b7756f3..2a5c328cff71bc9b466e28a8fdb985b41c5816ee 100644
--- a/Source/devtools/front_end/CodeMirrorTextEditor.js
+++ b/Source/devtools/front_end/CodeMirrorTextEditor.js
@@ -759,12 +759,16 @@ WebInspector.CodeMirrorTextEditor.prototype = {
*/
setExecutionLine: function(lineNumber)
{
+ this.clearPositionHighlight();
this._executionLine = this._codeMirror.getLineHandle(lineNumber);
+ if (!this._executionLine)
+ return;
this._codeMirror.addLineClass(this._executionLine, "wrap", "cm-execution-line");
},
clearExecutionLine: function()
{
+ this.clearPositionHighlight();
if (this._executionLine)
this._codeMirror.removeLineClass(this._executionLine, "wrap", "cm-execution-line");
delete this._executionLine;
@@ -821,7 +825,7 @@ WebInspector.CodeMirrorTextEditor.prototype = {
clearTimeout(this._clearHighlightTimeout);
delete this._clearHighlightTimeout;
- if (this._highlightedLine)
+ if (this._highlightedLine)
this._codeMirror.removeLineClass(this._highlightedLine, null, "cm-highlight");
delete this._highlightedLine;
},
« no previous file with comments | « no previous file | Source/devtools/front_end/SourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698