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

Unified Diff: Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 472793002: DevTools: Make TextEditor.tokenAtTextPosition() return exclusive end column (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix remaining cases Created 6 years, 4 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 | « Source/devtools/front_end/sources/CSSSourceFrame.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sources/JavaScriptSourceFrame.js
diff --git a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
index e8f536b163a05f698b6eb10ddfdf4a83bae862e9..4e8418bed878543fca23cfb4f87542f4f05c46eb 100644
--- a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
+++ b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -515,20 +515,20 @@ WebInspector.JavaScriptSourceFrame.prototype = {
return;
var lineNumber = textPosition.startLine;
var line = this.textEditor.line(lineNumber);
- var tokenContent = line.substring(token.startColumn, token.endColumn + 1);
+ var tokenContent = line.substring(token.startColumn, token.endColumn);
var isIdentifier = token.type.startsWith("js-variable") || token.type.startsWith("js-property") || token.type == "js-def";
if (!isIdentifier && (token.type !== "js-keyword" || tokenContent !== "this"))
return;
var leftCorner = this.textEditor.cursorPositionToCoordinates(lineNumber, token.startColumn);
- var rightCorner = this.textEditor.cursorPositionToCoordinates(lineNumber, token.endColumn + 1);
+ var rightCorner = this.textEditor.cursorPositionToCoordinates(lineNumber, token.endColumn - 1);
var anchorBox = new AnchorBox(leftCorner.x, leftCorner.y, rightCorner.x - leftCorner.x, leftCorner.height);
anchorBox.highlight = {
lineNumber: lineNumber,
startColumn: token.startColumn,
- endColumn: token.endColumn
+ endColumn: token.endColumn - 1
};
return anchorBox;
« no previous file with comments | « Source/devtools/front_end/sources/CSSSourceFrame.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698