Hi,

On Mon, Jul 25, 2016 at 10:42 AM, chdiza <[email protected]> wrote:

> The new getcompletion() function is of limited usefulness if one wants to
> use it for any "type" that might return directory names. That's because it
> doesn't append the trailing slash to dir names. That means that
> getcompletion()'s results don't actually match what you would get at the
> command line by pressing .
>
> For example: from the command line, :cd myd<TAB> yields :cd mydir/. Yet echo
> getcompletion('myd', 'dir') yields mydir.
>
> This could be worked around by calling map() on the result of
> getcompletion() to append the slashes. But that only works for the type
> "dir". For "file", one can't just append slashes because some of
> getcompletion()'s matches will be file names, not dir names.
>
> Example: Suppose in the cwd I have a dir names "mydir" and a file named
> "myfile".
>
> At the command line, :e my<TAB> will show mydir/ and then myfile if you
> hit again. But :echo getcompletion("my", "file") will show a list
> containing mydir and myfile. A blanket use of map() to append trailing
> slashes would result in myfile/ which is wrong.
>
> In short, getcompletion() should return a list that shows what would
> actually be presented at the command line. If that list contains dirnames,
> they should end in a slash. Otherwise, it isn't very useful in helping to
> define custom completion for files and dirs.
>
>
> This is easy to fix (need to add WILD_ADD_SLASH to options in
f_getcompletion()).
I will send out a patch later.

- Yegappan

-- 
-- 
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.

Raspunde prin e-mail lui