Bram Moolenaar <[email protected]> wrote:
> Christian Brabandt wrote:
>
>> Bram,
>> While looking into the improved cscope test from Dominique and trying to
>> find out, how to get commandline completion, I noticed a bug.
>>
>> Try this:
>> vim -u NONE -N
>> :echo getcompletion('', 'cscope')
>> ['add', 'find', 'help', 'kill', 'reset', 'show']
>> Now enter:
>> :cscope find <c-d><esc>
>> :echo getcompletion('', 'cscope')
>> ['a', 'c', 'd', 'e', 'f', 'g', 'i', 's', 't']
>> :cscope kill <c-d><esc>
>> :echo getcompletion('', 'cscope')
>> []
>>
>> So it looks like, depending on when <c-d> was used last time in the
>> commandline, that state is remembered and used again for the
>> getcompletion() function.
>>
>> Sorry, I have currently no time to look into the issue myself, just
>> thought I report what I found out.
>
> Thanks for reporting. This getcompletion() function may have a few more
> problems like this, since it's doing only half of what
> set_one_cmd_context() is doing. I'll fix this one, please look out for
> others.
Hi Bram
I see one more bug like this:
:echo getcompletion('', 'sign')
['define', 'jump', 'list', 'place', 'undefine', 'unplace']
:sign list <c-d><esc>
:echo getcompletion('', 'sign')
[]
Fixed in attached patch. I'll keep looking for more of these bugs.
Regards
Dominique
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 0095661..e9a1d7f 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4247,6 +4247,13 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern);
}
#endif
+#ifdef FEAT_SIGNS
+ if (xpc.xp_context == EXPAND_SIGN)
+ {
+ set_context_in_sign_cmd(&xpc, xpc.xp_pattern);
+ xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern);
+ }
+#endif
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL))