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

Unified Diff: third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js

Issue 2187173002: DevTools: Find bookmarks at line endpoints when calling _clearBookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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
Index: third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
index fe51527baac65db0f83ccae14ad9a0e96810ed68..56bfaa058012e21995256050307dc9275b97c592 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
@@ -1025,8 +1025,12 @@ WebInspector.CodeMirrorTextEditor.prototype = {
bookmarks: function(range)
{
var pos = WebInspector.CodeMirrorUtils.toPos(range);
- var markers = this._codeMirror.findMarks(pos.start, pos.end);
- return markers.filter(marker => marker.type === "bookmark");
+ if (range.isEmpty())
+ return this._codeMirror.findMarksAt(pos.start).filter(marker => marker.type === "bookmark");
+ var startMarkers = this._codeMirror.findMarksAt(pos.start);
+ var middleMarkers = this._codeMirror.findMarks(pos.start, pos.end);
+ var endMarkers = this._codeMirror.findMarksAt(pos.end);
+ return startMarkers.concat(middleMarkers, endMarkers).filter(marker => marker.type === "bookmark");
},
/**

Powered by Google App Engine
This is Rietveld 408576698