Dominique Pellé wrote: > Nazri Ramliy wrote: > ... >>>> Here is how I can reproduce it with Vim-7.3f (2562:5769dc787ec5): >>>> >>>> $ mkdir /tmp/foo >>>> $ vim -u NONE -N -c 'set wildmode=longest,list' >>>> >>>> :set path? >>>> path=.,/usr/include,, >>>> :cd " go to home dir >>>> :find /tmp/fo<Tab> " Good, completes to :find /tmp/foo/ >>>> :cd /tmp >>>> :find /tmp/fo<Tab> " Bad, does not complete anything >>>> >>>> I assume that's not the expected behavior. >>> >>> OK, I see it now. It's interference between "longest" in 'wildmode' and >>> the shortening that the :find completion is doing. Using CTRL-L shows >>> it without changing the 'wildmode' option. >>> >>> At the last step, if you use CTRL-D instead of <Tab>, you see it lists >>> "foo/". That's the shortened version of "/tmp/foo/". The method >>> "longest" uses to find the longest common string doesn't really work >>> here, because when there are multiple matches you get a short string >>> which then has a different meaning. The shortening for :find completion >>> only works if you use the whole result. >>> >>> Example: Suppose /tmp/foobar and /tmp/foofoo exist. Then completing >>> ":find /tmp/fo" would result in ":find foo", since "foo" is the longest >>> common part of "foobar" and "foofoo". But removing "/tmp/" now has >>> changed the meaning, further completion on ":find foo" will give a >>> different set of results. >>> >>> I'll add a remark in the todo list. >> >> Attached patch fixes this issue. >> >> nazri > > Hi Nazri. Thanks for the fix. > > There is something else which I see with Vim-7.3g 2570:42bdbc2bbb59 > > $ vim -u NONE -N > :find $HOM<Tab> " does not complete (would be nice to complete env > variables) > > Now something weirder: > :find $HOME/<Tab> " completes to /home/pel/$HOME/ (that's not right). > > Now I see the almost the same thing happening with :e as well: > > :e $HOME/<Tab> " completes to /home/pel/\$HOME/ > > That does not look right, I would expect it to complete to /home/pel/ > I see the same bug in Vim-7.2.446.
Sorry the issue of expanding ":e $HOME/<Tab>" to ":e /home/pel\$HOME" is not a bug after all. I did have a file called '/home/pel/\$HOME'! I did not remember it but I created such an odd file name a long time ago to check that Vim would not expand HOME in such file name. But not expanding ":find $HOM<Tab>" is still a (minor) issue. Expansion does happens with ":e $HOM<Tab>". 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
