On 2011-09-07, James Vega wrote:
> On Wed, Sep 07, 2011 at 02:16:59PM -0700, Gary Johnson wrote:
> > When a buffer is modified by a BufRead autocommand or by a filetype
> > plugin, 'modified' is not set.
>
> This is documented in the text below ":help gzip-example".
>
> The commands executed for the BufNewFile, BufRead/BufReadPost,
> BufWritePost, FileAppendPost and VimLeave events do not set or reset
> the changed flag of the buffer. ... If you do want the buffer to be
> marked as modified, set the 'modified' option.
Odd. I would think it would be the other way around: If an
autocommand modifies a buffer and you don't want it marked as
modified, set the 'nomodified' option. That would follow the
principle of least surprise.
I didn't think to look under ":help gzip-example" but I did read
":help 'modified'" a couple of times.
I think ":help 'modified'" should include an additional paragraph
after item 2:
This option is not set when a change is made as the result of a
BufNewFile, BufRead/BufReadPost, BufWritePost, FileAppendPost or
VimLeave autocommand event.
Thanks for the explanation and the pointer.
Regards,
Gary
--
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