Skip to content

Instantly share code, notes, and snippets.

@watiko
Created March 28, 2016 14:05
Show Gist options
  • Save watiko/9998af831e3d37c70b2c to your computer and use it in GitHub Desktop.
Save watiko/9998af831e3d37c70b2c to your computer and use it in GitHub Desktop.
Vim cmdline autoload variable completion
diff --git a/src/eval.c b/src/eval.c
index ea7f909..2ced3b6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3399,6 +3399,12 @@ set_context_for_expression(
got_eq = TRUE;
xp->xp_context = EXPAND_EXPRESSION;
}
+ else if ((c == '#')
+ && xp->xp_context == EXPAND_EXPRESSION)
+ {
+ /* Autoload function/variable contains '#'. */
+ break;
+ }
else if ((c == '<' || c == '#')
&& xp->xp_context == EXPAND_FUNCTIONS
&& vim_strchr(xp->xp_pattern, '(') == NULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment