diff --git a/TODO b/TODO index fe75f92b..5bb42105 100644 --- a/TODO +++ b/TODO @@ -5,9 +5,8 @@ Priority list: BUGS: - switching tabs while HINT_MODE_ALWAYS is on does not redisplay hints in new tabs, but exits hint mode - autoupdate does not work -- multiple windows to not work at all, so :q will close the whole browser session, even when there are other windows which has tabs +- multiple windows do not work at all, so :q will close the whole browser session, even when there are other windows which has tabs - http://en.wikipedia.org/wiki/Portal:Current_events - 'f' shows more hints than 'F' (on left side of nav bar) -- gu and gU don't work on local files properly - dpb| 09:09:56 dpb :: when I save a page with vimperator, it adds near the end of it.. kinda annoying dpb| 09:11:50 dpb :: and this happens only when saving the complete @@ -15,9 +14,9 @@ BUGS: - add window resize support to hints - can't reverse tab through the vimperator toolbar - gu doesn't work when the current URL contains a trailing slash +- gu and gU don't work on local files properly FEATURES: -9 :map commands to keys 9 :command for new commands 8 middleclick in content == p, and if command line is open, paste there the clipboard buffer 8 Use our own find-as-you-type mechanism (like conkeror does) diff --git a/chrome/content/vimperator/bookmarks.js b/chrome/content/vimperator/bookmarks.js index a188628a..1c5f8f5d 100644 --- a/chrome/content/vimperator/bookmarks.js +++ b/chrome/content/vimperator/bookmarks.js @@ -162,11 +162,25 @@ function Bookmarks() //{{{ var firefox_engines = search_service.getVisibleEngines({ }); for (var i in firefox_engines) { - if (!firefox_engines[i].alias || !firefox_engines[i].alias.match(/^[a-z0-9_]+$/)) + var alias = firefox_engines[i].alias; + if (!alias || !alias.match(/^[a-z0-9_-]+$/)) + alias = firefox_engines[i].name.replace(/^\W*([a-zA-Z_-]+).*/, "$1").toLowerCase(); + if (!alias) + alias = "search"; // for search engines which we can't find a suitable alias + + // make sure we can use search engines which would have the same alias (add numbers at the end) + var newalias = alias; + for (var j = 1; j <= 10; j++) // <=10 is intentional { - var alias = firefox_engines[i].name.replace(/^\W*(\w+).*/, "$1").toLowerCase(); - firefox_engines[i].alias = alias; + if (!search_engines.some( function(item) { return (item[0] == newalias); } )) + break; + + newalias = alias + j.toString(); } + // only write when it changed, writes are really slow + if (firefox_engines[i].alias != newalias) + firefox_engines[i].alias = newalias; + search_engines.push([firefox_engines[i].alias, firefox_engines[i].description]); } diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 74d6b6bd..e64b0374 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -709,8 +709,10 @@ function Commands() //{{{ "" + "
  • Opened with the specified search engine if the token looks like a search string " + - "and the first word of the token is the name of a search engine (:open wikipedia linus torvalds " + - "will open the wikipedia entry for linux torvalds).
  • " + + "and the first word is the name of a search engine (:open wikipedia linus torvalds " + + "will open the wikipedia entry for linux torvalds). The short name of a search engine is automatically guessed from it's name. " + + "If you want to set a custom name, open the $FIREFOX_PROFILE/searchplugins/*.xml file of the search engine, and add/change " + + "<Alias>myalias</Alias> " + "
  • Opened with the default search engine or keyword (specified with the 'defsearch' option) " + "if the first word is no search engine (:open linus torvalds will open a google search for linux torvalds).
  • " + "
  • Passed directly to Firefox in all other cases (:open www.osnews.com, www.slashdot.org will " +