aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJez Ng2012-11-02 12:09:43 -0700
committerJez Ng2012-11-02 12:09:43 -0700
commit3759eba701c50390bfda78f003d5c3a78acc2ef4 (patch)
treef4250e82523447127c15c4983fa3ad2b6882e815
parent4b58e9defe25cb851f5a7fa7ae957a2d5d2170d0 (diff)
parent2401c53250b98cca4b70a920c58782c52cc685dd (diff)
downloadvimium-3759eba701c50390bfda78f003d5c3a78acc2ef4.tar.bz2
Merge pull request #701 from smblott-github/bookmark-order
Bookmark - traversal order fixes
-rw-r--r--background_scripts/completion.coffee6
1 files changed, 3 insertions, 3 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index f7313756..79f31073 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -112,11 +112,11 @@ class BookmarkCompleter
# Traverses the bookmark hierarchy, and retuns a flattened list of all bookmarks in the tree.
traverseBookmarks: (bookmarks) ->
results = []
- toVisit = bookmarks
+ toVisit = bookmarks.reverse()
while toVisit.length > 0
- bookmark = toVisit.shift()
+ bookmark = toVisit.pop()
results.push(bookmark)
- toVisit.push.apply(toVisit, bookmark.children) if (bookmark.children)
+ toVisit.push.apply(toVisit, bookmark.children.reverse()) if (bookmark.children)
results
computeRelevancy: (suggestion) ->