From: Daniel Carl <danielcarl@gmx.de>
Date: Mon, 19 Nov 2012 18:24:30 +0000 (+0100)
Subject: Fixed regression in complation with numberd prefixes.
X-Git-Url: https://git.owens.tech/projects.html/projects.html/git?a=commitdiff_plain;h=f51c79e6741321024dc34b7d7341bb00634d1e43;p=vimb.git

Fixed regression in complation with numberd prefixes.

Inputs like :50j could not be completed anymore by a previous commit. This
patch fixes the issue.
---

diff --git a/src/completion.c b/src/completion.c
index eb03efe..3f0d46d 100644
--- a/src/completion.c
+++ b/src/completion.c
@@ -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) {