From: Daniel Carl <danielcarl@gmx.de>
Date: Sun, 24 Mar 2013 14:56:31 +0000 (+0100)
Subject: Simplified the SEARCH_* enum.
X-Git-Url: https://git.owens.tech/editable-focus.html/editable-focus.html/git?a=commitdiff_plain;h=489fd51b5bb4c7698cb3334d35b6499493f8b3a9;p=vimb.git

Simplified the SEARCH_* enum.

now we use -1 for backward and 1 for forward which is easier to use in the
most cases.
---

diff --git a/src/command.c b/src/command.c
index f1368fc..b1468a9 100644
--- a/src/command.c
+++ b/src/command.c
@@ -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) {
diff --git a/src/main.h b/src/main.h
index 0fb0211..bf0202c 100644
--- a/src/main.h
+++ b/src/main.h
@@ -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 {