diff src/cmdexpand.c @ 32949:6e346800670c

Add missing changes
author Christian Brabandt <cb@256bit.org>
date Sun, 20 Aug 2023 22:12:43 +0200
parents 757409cf4e8a
children 29b2193466e0
line wrap: on
line diff
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -4022,6 +4022,7 @@ f_getcompletion(typval_T *argvars, typva
     {
 	xpc.xp_pattern = pat;
 	xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern);
+        xpc.xp_line = pat;
 
 	xpc.xp_context = cmdcomplete_str_to_type(type);
 	if (xpc.xp_context == EXPAND_NOTHING)
@@ -4030,6 +4031,30 @@ f_getcompletion(typval_T *argvars, typva
 	    return;
 	}
 
+	if (xpc.xp_context == EXPAND_USER_DEFINED)
+	{
+            // Must be "custom,funcname" pattern
+            if (STRNCMP(type, "custom,", 7) != 0)
+            {
+                semsg(_(e_invalid_argument_str), type);
+                return;
+            }
+
+            xpc.xp_arg = type + 7;
+	}
+
+	if (xpc.xp_context == EXPAND_USER_LIST)
+	{
+            // Must be "customlist,funcname" pattern
+            if (STRNCMP(type, "customlist,", 11) != 0)
+            {
+                semsg(_(e_invalid_argument_str), type);
+                return;
+            }
+
+            xpc.xp_arg = type + 11;
+	}
+
 # if defined(FEAT_MENU)
 	if (xpc.xp_context == EXPAND_MENUS)
 	{