diff options
| author | Stephen Blott | 2014-05-18 12:47:50 +0100 |
|---|---|---|
| committer | Stephen Blott | 2014-05-18 12:47:50 +0100 |
| commit | 5d1b563de8f504c4175f4c203534955b97496281 (patch) | |
| tree | a369884b157906d9624183e7a958dd77af15d1f8 | |
| parent | f3f5d7b281fe561556132f22a6da3578e7d7a5a0 (diff) | |
| download | vimium-5d1b563de8f504c4175f4c203534955b97496281.tar.bz2 | |
Strip top-level chrome folders.
| -rw-r--r-- | background_scripts/completion.coffee | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index afaec4ea..fb3356da 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -140,7 +140,17 @@ class BookmarkCompleter # Traverses the bookmark hierarchy, and returns a flattened list of all bookmarks. traverseBookmarks: (bookmarks) -> results = [] - bookmarks.forEach (folder) => @traverseBookmarksRecursive folder, results + bookmarks.forEach (folder) => + # folder is a chrome virtual root folder. + folder.children.forEach((folder) => + # folder is one of the chrome, built-in folders ("Other Bookmarks", "Mobile Bookmarks", ...). + folder.children.forEach((bookmark) => + # bookmark is a user-defined folder, or itself a bookmark. + @traverseBookmarksRecursive bookmark, results)) + # + # We do not add the (possible) bookmark itself. The user has used the "/" key to begin searching + # within bookmark folders. It's not clear what that even means for top-level bookmarks. + # results.push bookmark results # Recursive helper for `traverseBookmarks`. |
