Hi,
On Tue, Jul 26, 2016 at 2:17 PM, chdiza <[email protected]> wrote:
> Actually, I seem to have found a problem with it.
>
> Suppose I have a dir named "Desktop" in my $HOME. From a Vim whose cwd is
> $HOME:
>
> echo getcompletion("de", "dir")
>
> Gives ['Desktop/*']. Note the asterisk, which messes things up if you
> want to use getcompletion() to soup-up ordinary dirname completion. For
> example, compare :cd De<TAB><TAB> to
>
The getcompletion() function adds a star to the supplied pattern to get
all the matches. If the expansion fails, then the star is not removed.
The expansion may fail if the directory doesn't exist or if there are no
sub-directories under the specified directory. That is why you are seeing
a star at the end of the returned match. I will see how this can be fixed.
- Yegappan
> ec getcompletion(getcompletion("Desktop/", "dir")[0], "dir")
>
> The former has no asterisk, the latter has one. That means that using call
> input("CD to: ", "", "customlist,Foo"), where the function Foo is defined
> thus
>
> func Foo(A,L,P)
> return getcompletion(a:A, "dir")
> endfunc
>
> will be such that hitting twice after "D" at the prompt will give
> Desktop/*, when it should just give Desktop/.
>
>
>
--
--
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.