Allow to use count for the browser history.
authorDaniel Carl <danielcarl@gmx.de>
Sun, 23 Dec 2012 22:36:09 +0000 (23:36 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 23 Dec 2012 22:36:09 +0000 (23:36 +0100)
Now it's possible to go multiply step back or forward in the history by
:[n]back or :[n]forward and also via keybindings.

src/command.c

index edcf92a..60f5ace 100644 (file)
@@ -162,9 +162,9 @@ gboolean command_view_source(const Arg* arg)
 gboolean command_navigate(const Arg* arg)
 {
     if (arg->i <= VP_NAVIG_FORWARD) {
-        /* TODO allow to set a count for the navigation */
+        gint count = vp.state.count ? vp.state.count : 1;
         webkit_web_view_go_back_or_forward(
-            vp.gui.webview, (arg->i == VP_NAVIG_BACK ? -1 : 1)
+            vp.gui.webview, (arg->i == VP_NAVIG_BACK ? -count : count)
         );
     } else if (arg->i == VP_NAVIG_RELOAD) {
         webkit_web_view_reload(vp.gui.webview);