From: Daniel Carl Date: Fri, 27 Sep 2013 22:14:22 +0000 (+0200) Subject: Removed nor more used count. X-Git-Url: https://git.owens.tech/assets/static/git.owens.tech/assets/static/git.owens.tech/git?a=commitdiff_plain;h=2bbe0bfaf37f516776df651073edf42c2cc5623b;p=vimb.git Removed nor more used count. --- diff --git a/src/command.c b/src/command.c index 04bb7ae..3aabcfa 100644 --- a/src/command.c +++ b/src/command.c @@ -29,7 +29,7 @@ extern VbCore vb; -gboolean command_search(const Arg *arg) +gboolean command_search(const Arg *arg, unsigned int count) { static SearchDirection dir; static char *query = NULL; @@ -56,7 +56,6 @@ gboolean command_search(const Arg *arg) forward = !(arg->i ^ dir); if (query) { - int count; #ifdef FEATURE_SEARCH_HIGHLIGHT if (!highlight) { /* highlight matches if the search is started new or continued @@ -70,8 +69,6 @@ gboolean command_search(const Arg *arg) } #endif - /* make sure we have a count greater than 0 */ - count = vb.state.count ? vb.state.count : 1; do { if (!webkit_web_view_search_text(vb.gui.webview, query, false, forward, true)) { break; @@ -79,9 +76,6 @@ gboolean command_search(const Arg *arg) } while (--count); } - /* unset posibble set count */ - vb.state.count = 0; - return true; } diff --git a/src/command.h b/src/command.h index b6de228..42426a8 100644 --- a/src/command.h +++ b/src/command.h @@ -46,7 +46,7 @@ enum { }; #endif -gboolean command_search(const Arg *arg); +gboolean command_search(const Arg *arg, unsigned int count); gboolean command_history(const Arg *arg); gboolean command_yank(const Arg *arg); gboolean command_save(const Arg *arg); diff --git a/src/ex.c b/src/ex.c index afc17cc..ecc74a1 100644 --- a/src/ex.c +++ b/src/ex.c @@ -357,7 +357,7 @@ static void input_activate(void) case '?': history_add(HISTORY_SEARCH, cmd, NULL); mode_enter('n'); - command_search(&((Arg){forward ? COMMAND_SEARCH_FORWARD : COMMAND_SEARCH_BACKWARD, cmd})); + command_search(&((Arg){forward ? COMMAND_SEARCH_FORWARD : COMMAND_SEARCH_BACKWARD, cmd}), 1); break; case ';': diff --git a/src/main.c b/src/main.c index ec7cbc4..1be841c 100644 --- a/src/main.c +++ b/src/main.c @@ -257,13 +257,6 @@ void vb_update_statusbar() int max, val, num; GString *status = g_string_new(""); - /* show current count */ - g_string_append_printf(status, "%.0d", vb.state.count); - /* show current modkey */ - if (vb.state.modkey) { - g_string_append_c(status, vb.state.modkey); - } - /* show the active downloads */ if (vb.state.downloads) { num = g_list_length(vb.state.downloads); diff --git a/src/main.h b/src/main.h index 7e12767..183d5d4 100644 --- a/src/main.h +++ b/src/main.h @@ -266,8 +266,6 @@ typedef struct { /* state */ typedef struct { - char modkey; - guint count; guint progress; StatusType status_type; MessageType input_type; diff --git a/src/normal.c b/src/normal.c index 104f75f..12f5599 100644 --- a/src/normal.c +++ b/src/normal.c @@ -218,7 +218,7 @@ void normal_enter(void) void normal_leave(void) { /* TODO clean those only if they where active */ - command_search(&((Arg){COMMAND_SEARCH_OFF})); + command_search(&((Arg){COMMAND_SEARCH_OFF}), 0); } /** @@ -272,11 +272,7 @@ static VbResult normal_clear_input(const NormalCmdInfo *info) { vb_set_input_text(""); gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview)); - /* TODO implement the search new - so we can remove the command.c file */ - command_search(&((Arg){COMMAND_SEARCH_OFF})); - /* check flags on the current state to only clear hints if they where - * enabled before */ - /*hints_clear();*/ + command_search(&((Arg){COMMAND_SEARCH_OFF}), 0); return RESULT_COMPLETE; } @@ -585,7 +581,10 @@ static VbResult normal_scroll(const NormalCmdInfo *info) static VbResult normal_search(const NormalCmdInfo *info) { - command_search(&((Arg){info->cmd == 'n' ? COMMAND_SEARCH_FORWARD : COMMAND_SEARCH_BACKWARD})); + command_search( + &((Arg){info->cmd == 'n' ? COMMAND_SEARCH_FORWARD : COMMAND_SEARCH_BACKWARD}), + info->count > 0 ? info->count : 1 + ); return RESULT_COMPLETE; } @@ -599,7 +598,10 @@ static VbResult normal_search_selection(const NormalCmdInfo *info) return RESULT_ERROR; } - command_search(&((Arg){info->cmd == '*' ? COMMAND_SEARCH_FORWARD : COMMAND_SEARCH_BACKWARD, query})); + command_search( + &((Arg){info->cmd == '*' ? COMMAND_SEARCH_FORWARD : COMMAND_SEARCH_BACKWARD, query}), + info->count > 0 ? info->count : 1 + ); g_free(query); return RESULT_COMPLETE;