On Fri, Feb 18, 2011 at 10:24 AM, Ben Fritz <[email protected]> wrote: > > > On Feb 15, 10:48 am, Donald Allen <[email protected]> wrote: >> I'm a fairly recent convert to vim, after using emacs for many, many >> years (I used the very first version of emacs, built on top of Teco, >> on Tenex on a DEC PDP-10; I guess just dated myself!). >> >> The issue: using gvim (I think the same issue happens with vim, but >> the error message comes and goes so quickly I can't be sure), if I >> invoke :ed <partial unambiguous dirname> and then hit tab to complete >> the dirname, netrw produces the directory listing, but I get the error >> "Illegal file name" at the bottom of the window. I note that when tab >> completes a directory name, it adds a trailing /. If, in a fresh gvim, >> I instead type in the entire directory name *without the trailing >> slash*, the error message does not appear. In addition, if I do this >> and type the trailing /, I *do* get the error message. To further >> confuse matters, after netrw produces the directory listing of, say, >> ~/foo, if I then type ":ed foo/" or ":ed fo<tab>", no error occurs, >> despite the trailing /. >> >> While this behavior causes no loss of functionality, the error message is >> incorrect, in my opinion, especially given that it does not always >> occur, as described above. >> >> All of the above refers to vim 7.3, including patches 1-99, compiled >> from source and installed on a Slackware 13.1 i486 system. >> > > The directory listing is done entirely by the netrw plugin. Netrw is > just like any other plugin. Vim has no way to know netrw is going to > handle the directory "edit". Without netrw, editing a directory > correctly gives an error. With netrw, Vim acts the same way. > > There is not really any way around this.
I understand what you are saying, but one of us is missing something. :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? If 'bar' is a directory, ls foo/bar and ls foo/bar/ produce the same result -- the directory listing. No complaints about trailing slashes. It seems to me that vim/gvim ought to respond the same way -- "foo/bar/ is a directory" with or without the trailing slash. Especially since it puts the slash there in response to tab. What I'm saying has absolutely nothing to do with what you point out above -- that subsequent to producing the message(s) I'm discussing, a plugin gets invoked. It has to do with vim's response to the :ed command. And then there's the issue that after invoking netrw, :ed's behavior w.r.t. trailing slashes changes and the "Illegal file name" messages no longer appear, even with a trailing slash. While you might contend this is all nit-picky, it's bothersome, because to the end user (who isn't thinking about internal implementation details), the editor is not behaving in a manner that's either consistent with what you get from things like 'ls' or even consistent with itself, the behavior changing after netrw is on the scene. Google and you will find others complaining about this. While I fully concede this isn't earth-shaking, I think it can be fixed and ought to be fixed. Thanks for your response. /Don > > -- > 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 > -- 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
