Monday, November 10, 2014

Re: ** matches one or more directories, not zero or more

On Monday, November 10, 2014 1:50:54 PM UTC-5, Christian Brabandt wrote:
> On Mo, 10 Nov 2014, ds26gte wrote:
>
> > The path pattern ** seems to require at least one explicit directory in the directory subpath that it matches. E.g., let's say we have
> >
> > au bufread,bufnewfile ~/**/*.ex let b:starstar_check = 1
> >
> > Now, editing a file ~/tmp/a.ex will, as expected, set its b:starstar_check to be set.
> >
> > However, editing a file ~/b.ex does not set b:starstar_check.
> >
> > Is this expected behavior, and if so, what is the preferred way to capture all the files (recursively) in a directory?
>
> I would say, it is expected behaviour, because the '/' in your pattern
> forces a match of a directory.

This doesn't match shell behavior of ** (for shells that have it, like bash).

Even if ~/**/*.ex is deemed to keep the '/', the empty instantiation of the ** pattern would give ~//*.ex, which is equivalent to ~/*.ex, as consecutive /'s in a path collapse into a single /, even in Vim.

Regards,
--dorai

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: