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

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

Issue 131033004: DevTools: introduce goto-column functionality (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed spaces Created 6 years, 11 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/FilteredItemSelectionDialog.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 52f799d0dd9c0393ef104009b8d1656913b55884..79a3fd56e25c17ff4f0ceb55ffa802100182d9b9 100644
--- a/Source/devtools/front_end/CodeMirrorTextEditor.js
+++ b/Source/devtools/front_end/CodeMirrorTextEditor.js
@@ -805,11 +805,10 @@ WebInspector.CodeMirrorTextEditor.prototype = {
*/
highlightPosition: function(lineNumber, columnNumber)
{
- if (lineNumber < 0)
- return;
- lineNumber = Math.min(lineNumber, this._codeMirror.lineCount() - 1);
- if (typeof columnNumber !== "number" || columnNumber < 0 || columnNumber > this._codeMirror.getLine(lineNumber).length)
+ lineNumber = Number.constrain(lineNumber, 0, this._codeMirror.lineCount() - 1);
+ if (typeof columnNumber !== "number")
columnNumber = 0;
+ columnNumber = Number.constrain(columnNumber, 0, this._codeMirror.getLine(lineNumber).length);
this.clearPositionHighlight();
this._highlightedLine = this._codeMirror.getLineHandle(lineNumber);
« no previous file with comments | « no previous file | Source/devtools/front_end/FilteredItemSelectionDialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698