Simplified the SEARCH_* enum.
authorDaniel Carl <danielcarl@gmx.de>
Sun, 24 Mar 2013 14:56:31 +0000 (15:56 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 24 Mar 2013 14:56:31 +0000 (15:56 +0100)
now we use -1 for backward and 1 for forward which is easier to use in the
most cases.

src/command.c
src/main.h

index f1368fc..b1468a9 100644 (file)
@@ -526,7 +526,7 @@ gboolean command_zoom(const Arg* arg)
 gboolean command_history(const Arg* arg)
 {
     const int count = vb.state.count ? vb.state.count : 1;
-    const gint step = count * (arg->i == VB_SEARCH_BACKWARD ? -1 : 1);
+    const gint step = count * arg->i;
     const char* entry = history_get(HISTORY_COMMAND, step);
 
     if (!entry) {
index 0fb0211..bf0202c 100644 (file)
@@ -152,9 +152,9 @@ enum {
 };
 
 typedef enum {
-    VB_SEARCH_FORWARD,
-    VB_SEARCH_BACKWARD,
-    VB_SEARCH_OFF,
+    VB_SEARCH_FORWARD  = 1,
+    VB_SEARCH_BACKWARD = -1,
+    VB_SEARCH_OFF      = 0
 } SearchDirection;
 
 typedef enum {