Closed pavoljuhas closed 4 years ago
ping @justinmk - let me know if there are any questions about this.
Problem: vim
glob()
does not match in subdirectories of some auto mounted paths, for example, in/home/autouser/docs/
. This is probably becauseautouser
does not glob in/home/
.
I don't totally understand this. Do you have a reference for this (doc, Vim issue, mailing list discussion)?
Problem: vim
glob()
does not match in subdirectories of some auto mounted paths, for example, in/home/autouser/docs/
. This is probably becauseautouser
does not glob in/home/
.I don't totally understand this. Do you have a reference for this (doc, Vim issue, mailing list discussion)?
After more testing I found the problem happens whenwildignorecase
is set. On my system ls /home
does not show automounted user directories, but they can be cd-ed to. I suspect wic
makes glob() expand [aA][uU][tT][oO][uU][sS][eE][rR]
which does not match the listing of /home. The reason globpath
seemed to help is because it does not use wic
(which glob does - https://github.com/vim/vim/blob/4da7a259f6b28a4f855a6fa7d0ede5e038600154/src/filepath.c#L1192-L1193).
The wic
is causing problems also with current master where it merges icase-equal directories.
mkdir /tmp/a /tmp/A
touch /tmp/a/a.txt /tmp/A/b.txt
vim -i NONE -U NONE -N -c 'set wic' -c 'Dirvish /tmp/a'
b.txt
a.txt
@justinmk - are you OK with changing this PR to use the original s:globlist
, but with unset wic
for the glob call?
The reason
globpath
seemed to help is because it does not usewic
(which glob does - https://github.com/vim/vim/blob/4da7a259f6b28a4f855a6fa7d0ede5e038600154/src/filepath.c#L1192-L1193).
...sure enough, from :help glob()
:
Unless the optional {nosuf} argument is given and is |TRUE|, the 'suffixes' and 'wildignore' options apply. ... 'wildignorecase' always applies.
classic Vim.
are you OK with changing this PR to use the original
s:globlist
, but with unsetwic
for the glob call?
Would rather use globpath() than setting/unsetting an option. Is there any disadvantage to globpath()?
Would rather use globpath() than setting/unsetting an option. Is there any disadvantage to globpath()?
Does not seem so. globpath() needs an extra escape for ,
otherwise it should be similar to glob().
I will get to this over the weekend.
Here is the next iteration which keeps path escapes from master. I have added additional escapes to prevent extra expansion for
,
- path separator in globpath();
- upward search syntax in 'path'*?
- globing of the 'path' valueThank you for fixing this! Nasty bug.
Fix dirvish for auto-mounted paths where mount root does not glob.
Problem: vim
glob()
does not match in subdirectories of some auto mounted paths, for example, in/home/autouser/docs/
. This is probably becauseautouser
does not glob in/home/
.Solution: use
globpath
instead ofglob
to do glob expansion only in leaf directory.