From 489fd51b5bb4c7698cb3334d35b6499493f8b3a9 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sun, 24 Mar 2013 15:56:31 +0100 Subject: [PATCH] Simplified the SEARCH_* enum. now we use -1 for backward and 1 for forward which is easier to use in the most cases. --- src/command.c | 2 +- src/main.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 { -- 2.20.1