> When you type ':echo <tab>', you can see complete candidates like variables,
> functions, or etc.
> But it include dict functions. For example,
>
> -------
> $ cat foo.vim
> let s:foo = {}
> function! s:foo.bar()
> endfunction
>
> $ vim -u foo.vim -N
> -------
>
> Type ":echo <tab>", it will be ":echo 1()".
> Below is a patch for fixing this problem.
>
> Note that this patch remove dict functions and script functions from
> complete candidates.
> I think completing of script functions is not useful for us like
> '<SNR>14_XXX'.
> Please check and include.
Makes sense. I wonder if we should still show the matches when the user
is explicitly looking for such a function.
--
hundred-and-one symptoms of being an internet addict:
46. Your wife makes a new rule: "The computer cannot come to bed."
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Makes sense. I wonder if we should still show the matches when the user
is explicitly looking for such a function.
On Sa, 08 Okt 2011, mattn wrote:
> Do you mean that vim have better to show candidate like following? (for
> example)
>
> :echo <SNR>14_foo
>
> and type <tab>
>
> :echo <SNR>14_foobar
>
> I think no need to show it.
Please don't turn that feature off. I use it all the time.
regards,
Christian
--
Die bescheidenen Menschen w�ren die berufenen Politiker, wenn sie
nicht so bescheiden w�ren.
-- Ernst R. Hauschka
> On Sa, 08 Okt 2011, mattn wrote:
>
> > Do you mean that vim have better to show candidate like following? (for
> > example)
> >
> > :echo <SNR>14_foo
> >
> > and type <tab>
> >
> > :echo <SNR>14_foobar
> >
> > I think no need to show it.
>
> Please don't turn that feature off. I use it all the time.
How about only showing these when the user has typed "<". I would like
that when typing ":call <Ctrl-D>" you only see alphabetic function
names.
--
hundred-and-one symptoms of being an internet addict:
48. You get a tatoo that says "This body best viewed with Netscape 3.1 or
higher."
>
> Christian Brabandt wrote:
>
>> On Sa, 08 Okt 2011, mattn wrote:
>>
>>> Do you mean that vim have better to show candidate like following?
>>> (for example)
>>>
>>> :echo <SNR>14_foo
>>>
>>> and type <tab>
>>>
>>> :echo <SNR>14_foobar
>>>
>>> I think no need to show it.
>>
>> Please don't turn that feature off. I use it all the time.
>
> How about only showing these when the user has typed "<". I would
> like that when typing ":call <Ctrl-D>" you only see alphabetic
> function names.
I also use this occasionally.
It makes sense to hide dictionary functions, because you can't call them
directly:
Doing: :call <Tab><CR>
Completes: :call 1()
Result: E129: Function name required
So, the result of the completion is something that doesn't
work. It doesn't make sense in context.
Script functions, though, can be called. So they're perfectly valid
candidates.
:call <Tab>(until reaching an example SNR function)
:call <SNR>19_LoadIndent()
Result: (it runs the function... i.e. It works fine.)
I vote for leaving them in the list.
--
Best,
Ben
That is fine for me. Also the comment from Benjamin is valid (remove only
dictionary functions).
regards,
Christian
It's a good idea to show the <SNR> functions last. "Normal" users don't
use them, and the cryptic names look intimidating.
> However, If I want to find global function leading "z", I may feed that
> "<SNR> functions are not useful for complete".
Wouldn't you then type z<Tab>, to only get functions starting with "z"?
The <SNR> functions wouldn't show up, then.
> We should hear another's comment more.
Here's another vote for keeping them in, at least when the "<SNR>" base
has already been typed (and preferably also at the end of the list of
all functions).
-- regards, ingo
> Thanks for all in this thread.
>
> I still don't assent that vim show <SNR> functions in complete candidates.
>
> And I wonder why they use ":echo <tab>" to get candidate from completion.
> I'm thinking who want to know SID are very minorities. And as Ingo
> Karkat says, <SNR> is the cryptic names look intimidating.
> As you know it, SID is not constant value. if you install scripts in
> your runtime path, followers in alphabetical get a different SID value
> with restarted.
> AFAIK, who want to know SID are developer. And they should know how to
> see SID of the script.
It's often useful to see or use script-local functions from a script
without using scriptnames. Some scripts have many functions they define
as script-local, some of which, especially when developing, you may want
to call. It's easier to Tab-complete them than to look up the number
followed by having to type the full function.
> 1. :scriptnames
> and find your script file.
>
> 2. :command Foo
> to find definition of the command which is defined in your script.
>
> 3. define function s:SID()
> see :help <SID>
>
> I want to prior normal users.
My vote is for <SNR> functions to sort to the end. It keeps them
tab-completable, but also prioritizes for normal users (if there is such
a thing as a "normal" Vim user).
--
Best,
Ben
> On 10/10/2011 03:43 PM, mattn wrote:
> > I hope that <SNR> functions should be following after global
> > functions. Is this a problem of sort?
> > Currently, <SNR> functions are there before global functions. it's not
> > useful.
>
> It's a good idea to show the <SNR> functions last. "Normal" users don't
> use them, and the cryptic names look intimidating.
Agreed. Leaving them out would result in the strange behavior that you
have to type a character to get more completions.
> > However, If I want to find global function leading "z", I may feed that
> > "<SNR> functions are not useful for complete".
>
> Wouldn't you then type z<Tab>, to only get functions starting with "z"?
> The <SNR> functions wouldn't show up, then.
>
> > We should hear another's comment more.
>
> Here's another vote for keeping them in, at least when the "<SNR>" base
> has already been typed (and preferably also at the end of the list of
> all functions).
>
> -- regards, ingo
--
Over the years, I've developed my sense of deja vu so acutely that now
I can remember things that *have* happened before ...
> Ok.
> Bram, If anyone don't object to this changes, please check and include.
>
> https://gist.github.com/1280464
Thanks! I'll add it in the todo list.
--
hundred-and-one symptoms of being an internet addict:
57. You begin to wonder how on earth your service provider is allowed to call
200 hours per month "unlimited."