Fixed no more working command completion with counts.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 8 Apr 2013 22:10:12 +0000 (00:10 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 8 Apr 2013 22:10:12 +0000 (00:10 +0200)
Commands with count could not be completed, because the count extraction was
removed in previous commits so that :5scro<tab> could not be completed.

src/completion.c

index ddd1111..c07600f 100644 (file)
@@ -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);