On Sat, 29 May 2004 at 12:47pm, Bram Moolenaar wrote:
> Hari Krishna Dara wrote:
> > If you set 'buftype', Vim disables the :w and :wq commands. But it
> > behaves the same even if you have BufWriteCmd autocommand defined for
> > the buffer, so defining the autocommand makes no difference. IMHO this
> > is incorrect. Vim should first check for a matching BufWriteCmd (and let
> > it get triggered as usual), and generate exception only when none is
> > found. However defining BufReadCmd seems to work fine even for
> > 'buftype' buffers.
> When you set 'buftype' to "nowrite" or "nofile" that means the buffer
> will not be written. It doesn't matter what autocommands you have
> defined for the buffer.
> A BufWriteCmd handles a special kind of writing for buffers, it doesn't
> make unwritable buffers writable.
When you have 'BufWriteCmd' defined, it means someone is explicitly
saying that the :w and :wq commands are to be handled differently, so
what is the harm in allowing them even on 'buftype' buffers? These
buffers are created almost always from the plugins for
the advantages they offer (like constant buffer name and 'modified' flag
being always unset among various other things). You might consider this
as feature enhancement request, but first I thought it as a bug as
BufReadCmd still worked. If this is not a bug, then I will have to think
of an alternate way of achieving what I want.
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.