From: Daniel Carl <danielcarl@gmx.de>
Date: Mon, 8 Apr 2013 22:10:12 +0000 (+0200)
Subject: Fixed no more working command completion with counts.
X-Git-Url: https://git.owens.tech/112-editable-focus.html/112-editable-focus.html/git?a=commitdiff_plain;h=9c9bb778550cf1f6288a14abbd52c8a487f6d3d6;p=vimb.git

Fixed no more working command completion with counts.

Commands with count could not be completed, because the count extraction was
removed in previous commits so that :5scro<tab> could not be completed.
---

diff --git a/src/completion.c b/src/completion.c
index ddd1111..c07600f 100644
--- a/src/completion.c
+++ b/src/completion.c
@@ -113,10 +113,14 @@ gboolean completion_complete(gboolean back)
 
         history_list_free(&source);
     } else {
+        char *command = NULL;
+        /* remove counts before command and save it to print it later in inputbox */
+        comps.count = g_ascii_strtoll(&input[1], &command, 10);
+
         source = g_list_sort(command_get_all(), (GCompareFunc)g_strcmp0);
         comps.completions = init_completion(
             comps.completions,
-            filter_list(tmp, source, (Comp_Func)g_str_has_prefix, &input[1]),
+            filter_list(tmp, source, (Comp_Func)g_str_has_prefix, command),
             ":"
         );
         g_list_free(source);