On Fri, Feb 18, 2011 at 4:54 PM, Benjamin Fritz <[email protected]> wrote:
> On Fri, Feb 18, 2011 at 10:07 AM, Donald Allen <[email protected]> wrote:
>>
>> :ed foo/bar produces the message
>>
>> "foo/bar" is a directory
>>
>> whereas :ed foo/bar/ (which is what you get if you hit tab to complete) 
>> produces
>>
>> "foo/bar" Illegal file name
>>
>> I understand that this is before the plugin is invoked, but why the 
>> difference?
>>
>>
>
> :ed foo/bar/ is trying to edit a file in the foo/bar directory, with
> an empty name. You cannot have a nameless file, hence "illegal file
> name".

I've already addressed this in my previous message (assume bar is a
sub-directory of the directory foo):

ls foo/bar/

produces a listing of the directory foo/bar, not "No such file or directory".

Furthermore (note the trailing slashes):

dca@sergei:/tmp$ mkdir foo
dca@sergei:/tmp$ mkdir foo/bar/
dca@sergei:/tmp$ ls -l foo
total 4
drwxr-xr-x 2 dca allen 4096 2011-02-18 23:13 bar
dca@sergei:/tmp$ cd foo/bar/
dca@sergei:/tmp/foo/bar$ pwd
/tmp/foo/bar
dca@sergei:/tmp/foo/bar$

To ls, mkdir, and cd, 'foo/bar/'='foo/bar', the directory bar in the
directory foo. vim's behavior is not consistent with any of this.
Furthermore, after vim issues the "Illegal file name" complaint about
:ed foo/bar/, it passes foo/bar/ to netrw, which happily generates the
directory listing. So vim is not even consistent with the netrw
plugin!

>
> :ed foo/bar is trying to edit a file called bar in the foo directory.
> This name would be valid, except that there is already a directory
> there with the same name. Hence, "foo/bar is a directory".

I understand all that. There's no issue there; that behavior is correct.

 I actually
> get this message regardless of whether netrw loads.
>

-- 
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

Raspunde prin e-mail lui