diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-05-17 02:16:56 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-05-17 02:16:56 -0400 |
commit | 50cf32775d1fb4ca8fdd6e0c2cc0486f27b57c4e (patch) | |
tree | e156b243f02ffc53d4f9ce4d1887f87ef0a61b31 /src/nvim/ex_cmds.c | |
parent | 3f3a3cb65f02b8088dea911094421f8ce79e521a (diff) | |
parent | ab60a73b6a9cdd5685161a80a797a567876cd40d (diff) | |
download | rneovim-50cf32775d1fb4ca8fdd6e0c2cc0486f27b57c4e.tar.gz rneovim-50cf32775d1fb4ca8fdd6e0c2cc0486f27b57c4e.tar.bz2 rneovim-50cf32775d1fb4ca8fdd6e0c2cc0486f27b57c4e.zip |
Merge pull request #4769 from jamessan/vim-7.4.1568
vim-patch:7.4.1568,7.4.1571,7.4.1728
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index e8314e02e0..415d6ee460 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4413,17 +4413,20 @@ int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_la || (arg[0] == '\\' && arg[1] == '{')) *d++ = '\\'; - for (s = arg; *s; ++s) { - /* - * Replace "|" with "bar" and '"' with "quote" to match the name of - * the tags for these commands. - * Replace "*" with ".*" and "?" with "." to match command line - * completion. - * Insert a backslash before '~', '$' and '.' to avoid their - * special meaning. - */ - if (d - IObuff > IOSIZE - 10) /* getting too long!? */ + // If tag starts with "('", skip the "(". Fixes CTRL-] on ('option'. + if (*arg == '(' && arg[1] == '\'') { + arg++; + } + for (s = arg; *s; s++) { + // Replace "|" with "bar" and '"' with "quote" to match the name of + // the tags for these commands. + // Replace "*" with ".*" and "?" with "." to match command line + // completion. + // Insert a backslash before '~', '$' and '.' to avoid their + // special meaning. + if (d - IObuff > IOSIZE - 10) { // getting too long!? break; + } switch (*s) { case '|': STRCPY(d, "bar"); d += 3; @@ -4484,6 +4487,12 @@ int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_la *d++ = *s; + // If tag contains "({" or "([", tag terminates at the "(". + // This is for help on functions, e.g.: abs({expr}). + if (*s == '(' && (s[1] == '{' || s[1] =='[')) { + break; + } + /* * If tag starts with ', toss everything after a second '. Fixes * CTRL-] on 'option'. (would include the trailing '.'). |