Manuel Ortega <[email protected]> wrote:

> The docs at :h file-pattern don't mention it, but I seem to be able to use
> "\=" just fine in autocmd patterns, and it seems to mean what it means in :h
> pattern-overview ("zero or one").
>
> For instance, `au SomeGroup *.[xgb]z2\= some_command` will fire on files
> with any of the following extensions:
>
>   .xz
>   .gz
>   .bz2
>   .bz
>
> Maybe this a fluke and it's not supposed to work this way.  But if it is
> supposed to work this way it should be in the docs at :h file-pattern
>
> -Manny

I think that it's not expected and I see it a bug.
glob2regpat() gives what look like unexpected
results for:

:echo glob2regpat('a\=')
Actual: ^a\=$
Expected: ^a\\=$

:echo glob2regpat('a\+')
Actual: ^a\+$
Expected: ^a\\+$

:echo glob2regpat('a\d')
Actual: ^a\d$
Expected: ^a\\d$

And many probably many other cases
where \ is special in regexp, but not special
in glob special characters.

The \ character is also interpreted differently
on Windows (directory separator) in glob patterns,
which is not clear to me. Will glob2regpat('a\=')
match files that start with "=" in the "a" directory
on Windows?

:help wildcard which describes glob special
characters is too short and not precise enough.

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.

Raspunde prin e-mail lui