Fixed regression in complation with numberd prefixes.
authorDaniel Carl <danielcarl@gmx.de>
Mon, 19 Nov 2012 18:24:30 +0000 (19:24 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Mon, 19 Nov 2012 18:24:30 +0000 (19:24 +0100)
Inputs like :50j could not be completed anymore by a previous commit. This
patch fixes the issue.

src/completion.c

index eb03efe..3f0d46d 100644 (file)
@@ -105,13 +105,14 @@ static GList* completion_init_completion(GList* target, GList* source, const gch
     gboolean match;
     gchar **token = NULL;
 
+    /* skip prefix for completion */
+    if (g_str_has_prefix(input, prefix)) {
+        input = input + strlen(prefix);
+    }
+
     /* remove counts before command and save it to print it later in inputbox */
     vp.comps.count = g_ascii_strtoll(input, &command, 10);
 
-    if (g_str_has_prefix(command, prefix)) {
-        command = command + strlen(prefix);
-    }
-
     token = g_strsplit(command, " ", -1);
 
     for (GList* l = source; l; l = l->next) {