Donal Allen wrote:
> I am running vim 7.3.659 on a 64-bit Arch Linux system. I am seeing
> what I believe to be a bug in the filename-completion logic as used in
> the :buffer command. To reproduce, do the following:
>
> 1. mkdir /tmp/foo
> 2. cd /tmp/foo
> 3. Somehow, create two files in /tmp/foo -- foo.c and bar.c.
> 4. Start vim. Enter ':e bar' followed by <tab>. It will complete to
> 'bar.c'. Hit <enter> to load the file. Do the same for foo.c. Note
> that after typing ':e foo' and then <tab>, it will complete to
> 'foo.c'.
> 5. You will have foo.c displayed in the vim window. If you enter ':b
> ba' followed by <tab>, it will complete to 'bar.c'. Hit <enter>. Now
> the window displays bar.c. Now type ':b fo' followed by <tab>; it
> will not complete. But if you hit <enter> at that point, the window
> will switch correctly to foo.c. I think the logic is getting confused
> by the directory name and the filename both being 'foo'. If you move
> the directory to /tmp/baz, the problem will not occur.
>
> My .vimrc:
[...]
> set wildmode=longest
[...]
This actually works correctly. Try using CTRL-D to see all matches.
You will see that it lists foo.c and /tmp/foo/bar.c. Getting the
longest common part results in nothing.
We can't really have "foo<Tab>" complete to "bar.c", that would be
weird. That's why you get the full path.
--
[SIR LAUNCELOT runs back up the stairs, grabs a rope
of the wall and swings out over the heads of the CROWD in a
swashbuckling manner towards a large window. He stops just short
of the window and is left swing pathetically back and forth.]
LAUNCELOT: Excuse me ... could somebody give me a push ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
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