philc/vimium — pull request #692 by smblott-github (2012-10-30 06:26:51+00:00)
Title: Use inorder traversal for bookmark ordering.

See #691.

Imagine I've set up the following bookmarks in the Bookmark Manager:

```
Bookmark (BBC AA)
Folder B:
Bookmark (BBC BA)
Bookmark (BBC BB)
Folder C:
Bookmark (BBC CA)
Bookmark (BBC CB)
Bookmark (BBC ZZ)

```

When searching for `BBC` in bookmarks, the vomnibar produces bookmarks in this order:
- `BBC AA` `BBC ZZ` `BBC BA` `BBC BB` `BBC CA` `BBC CB`

This is a *preorder* traversal. It respects the ordering of bookmarks, and the
ordering of folders, but *disregards the order in which the two are intermixed*.

I'd suggest that an *inorder* traversal is more appropriate. This better
respects the order defined in the Bookmarks Manager ... which is the *only*
mechanism available to control the ordering.

The *inorder* ordering is:
- `BBC AA` `BBC BA` `BBC BB` `BBC CA` `BBC CB` `BBC ZZ`

***

The concrete example I encountered is:
- `BBC AA` is "BBC News"
- folder `B` contains BBC radio stations
- folder `C` contains BBC TV stations
- and the rest are BBC bookmarks I use less frequently.