summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-17 15:53:24 +0100
committerBram Moolenaar <Bram@vim.org>2023-04-17 15:53:24 +0100
commit961b2e54bdbe1c06e4bf8ccf7a7e3deb129b45de (patch)
treeb031a7ff41162ab767a027ceadfc7442e1755a87 /src/ex_getln.c
parente7d49465a4ad390c1b0fb6d6b97bc30241fe5db9 (diff)
patch 9.0.1460: insufficient testing for getcmdcompltype()v9.0.1460
Problem: Insufficient testing for getcmdcompltype(). Solution: Add a few more test cases. (closes #12268)
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 36d148e79d..21447ff040 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4152,11 +4152,11 @@ get_cmdline_completion(void)
if (p == NULL || p->xpc == NULL)
return NULL;
- char_u *cmd_compl;
-
set_expand_context(p->xpc);
+ if (p->xpc->xp_context == EXPAND_UNSUCCESSFUL)
+ return NULL;
- cmd_compl = cmdcomplete_type_to_str(p->xpc->xp_context);
+ char_u *cmd_compl = cmdcomplete_type_to_str(p->xpc->xp_context);
if (cmd_compl != NULL)
return vim_strsave(cmd_compl);