patch 9.0.1956: Custom completion skips orig cmdline if it invokes glob()
Problem: Custom cmdline completion skips original cmdline when pressing
Ctrl-P at first match if completion function invokes glob().
Solution: Move orig_save into struct expand_T.
closes: #13216
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
diff --git a/src/structs.h b/src/structs.h
index 9813c4e..d718efe 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -610,6 +610,7 @@
// file name completion
int xp_col; // cursor position in line
int xp_selected; // selected index in completion
+ char_u *xp_orig; // originally expanded string
char_u **xp_files; // list of files
char_u *xp_line; // text being completed
#define EXPAND_BUF_LEN 256