diff --git a/ChangeLog b/ChangeLog index bbbfea8d..9191b21c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@
 date:
 	* version 0.4
+	* :back! goes to beginning of history now
+	* diabled firefox 3.0 support for now, as there are just too many small
+	  bugs
 	* :help 
supported, :help set will show help for the :set command (patch from Viktor Kojouharov) * :source support, and auto-sourcing ~/.vimperatorrc on startup diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 0a29d208..4c9bc8dc 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -47,8 +47,9 @@ var g_commands = [/*{{{*/ [ ["back", "ba"], "Go back in the browser history", - "Count is supported, :3back goes back 3 pages in the browser history.", - function(args, special, count) { stepInHistory(count > 0 ? -1 * count : -1); }, + "Count is supported, :3back goes back 3 pages in the browser history.
"+ + "The special version :back! goes to the beginning of the browser history.", + function(args, special, count) { if(special) historyGoToBeginning(); else stepInHistory(count > 0 ? -1 * count : -1); }, null ], [ @@ -145,8 +146,9 @@ var g_commands = [/*{{{*/ [ ["forward", "fw"], "Go forward in the browser history", - "Count is supported, :3forward goes forward 3 pages in the browser history.", - function(count) { stepInHistory(count > 0 ? count : 1); }, + "Count is supported, :3forward goes forward 3 pages in the browser history.
"+ + "The special version :back! goes to the beginning of the browser history.", + function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); }, null ], [ @@ -964,23 +966,41 @@ function echoerr(msg) function stepInHistory(steps) { var index = getWebNavigation().sessionHistory.index + steps; - if (index >= 0 && index < getWebNavigation().sessionHistory.count) { + if (index >= 0 && index < getWebNavigation().sessionHistory.count) + { getWebNavigation().gotoIndex(index); } else { beep(); if(index<0) - echo("Already at beginning of history"); + echo("Cannot go past beginning of history"); else - echo("Already at end of history"); + echo("Cannot go past end of history"); } } - -function goUp() // FIXME +function historyGoToBeginning() { - + var index = getWebNavigation().sessionHistory.index; + if (index == 0) + { + echo("Already at beginning of history"); + return; + } + getWebNavigation().gotoIndex(0); } +function historyGoToEnd() +{ + var index = getWebNavigation().sessionHistory.index; + var max = getWebNavigation().sessionHistory.count -1; + if (index == max) + { + echo("Already at end of history"); + return; + } + getWebNavigation().gotoIndex(max); +} + ////////////////////////////////////////////////////////////////////////