To: vim-dev@vim.org Subject: Patch 6.1.381 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.381 Problem: When a BufWriteCmd is used and it leaves the buffer modified, the window may still be closed. (Hari Krishna Dara) Solution: Return FAIL from buf_write() when the buffer is still modified after a BufWriteCmd autocommand was used. Files: src/fileio.c *** ../vim61.380/src/fileio.c Sat Mar 8 20:33:32 2003 --- src/fileio.c Sat Mar 8 14:29:27 2003 *************** *** 2539,2544 **** --- 2539,2548 ---- ml_timestamp(buf); buf->b_flags &= ~BF_WRITE_MASK; } + if (reset_changed && buf->b_changed) + /* Buffer still changed, the autocommands didn't work + * properly. */ + return FAIL; return OK; } EMSG(_("E203: Autocommands deleted or unloaded buffer to be written")); *** ../vim61.380/src/version.c Sun Mar 9 15:45:10 2003 --- src/version.c Sun Mar 9 15:47:12 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 381, /**/ -- A)bort, R)etry, P)lease don't bother me again /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///