1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: When a BufWriteCmd autocommand resets 'modified' this doesn't
12 change older buffer states to be marked as 'modified' like
13 ":write" does. (Yukihiro Nakadaira)
14 Solution: When the BufWriteCmd resets 'modified' then adjust the undo
15 information like ":write" does.
19 *** ../vim-7.3.289/src/fileio.c 2011-07-20 18:29:33.000000000 +0200
20 --- src/fileio.c 2011-08-29 21:49:27.000000000 +0200
24 else if (reset_changed && whole)
26 ! if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
27 ! sfname, sfname, FALSE, curbuf, eap)))
30 if (overwriting && bt_nofile(curbuf))
33 else if (reset_changed && whole)
35 ! int was_changed = curbufIsChanged();
37 ! did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
38 ! sfname, sfname, FALSE, curbuf, eap);
41 ! if (was_changed && !curbufIsChanged())
43 ! /* Written everything correctly and BufWriteCmd has reset
44 ! * 'modified': Correct the undo information so that an
45 ! * undo now sets 'modified'. */
46 ! u_unchanged(curbuf);
47 ! u_update_save_nr(curbuf);
53 if (overwriting && bt_nofile(curbuf))
54 *** ../vim-7.3.289/src/version.c 2011-08-28 16:02:23.000000000 +0200
55 --- src/version.c 2011-09-02 11:37:25.000000000 +0200
59 { /* Add new patch number below this line */
65 OLD WOMAN: Well, how did you become king, then?
66 ARTHUR: The Lady of the Lake, her arm clad in the purest shimmering samite,
67 held Excalibur aloft from the bosom of the water to signify by Divine
68 Providence ... that I, Arthur, was to carry Excalibur ... That is
70 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
72 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
73 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
74 \\\ an exciting new programming language -- http://www.Zimbu.org ///
75 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///