k-takata / minpac

A minimal package manager for Vim 8+ (and Neovim)
836 stars 30 forks source link

minpac update progress window name "a" #123

Closed habamax closed 3 years ago

habamax commented 3 years ago

For some reason I started getting "a" window instead of [minpac progress]:

image

and then if I press s I get following error:

image

vim version: 8.2.1965

This doesn't happen in windows vim of the same version.

habamax commented 3 years ago

The issue is in this line:

https://github.com/k-takata/minpac/blob/113380ec84fdac067a0b33c06409a2de0f3070f7/autoload/minpac/progress.vim#L46

If I try to do this command on wsl vim:

:file [minpac progress]

I get buffer named: a.

On the other hand:

:file \[minpac progress\]

works.

habamax commented 3 years ago

vim-minpac-issue

habamax commented 3 years ago

Aha!

I have a file named a in my home directory, and for some reason when you do :file [minpac progress] it names minpac progress buffer as a. I have removed this file and issues is gone.

But what if I need this a file? :)

habamax commented 3 years ago

On the other hand:

:file \[minpac progress\]

works.

But not on windows.

:h wildcards

                                                wildcard wildcards
Wildcards in {file} are expanded, but as with file completion, 'wildignore'
and 'suffixes' apply.  Which wildcards are supported depends on the system.
These are the common ones:
        ?       matches one character
        *       matches anything, including nothing
        **      matches anything, including nothing, recurses into directories
        [abc]   match 'a', 'b' or 'c'
habamax commented 3 years ago

So the issue is that buffer name [minpac progress] is a wildcard that would match files: m, i, n, p, a, c, r, o, g, e, s.

habamax commented 3 years ago

Another option would be to replace exec with backtick expansion (:h `=):

 " exec "silent file" l:bufname
 silent file `=l:bufname`

Works for me both on wls debian and windows

k-takata commented 3 years ago

Thank you for investigating the issue.