mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.3.290
Problem: When a BufWriteCmd autocommand resets 'modified' this doesn't change older buffer states to be marked as 'modified' like ":write" does. (Yukihiro Nakadaira) Solution: When the BufWriteCmd resets 'modified' then adjust the undo information like ":write" does.
This commit is contained in:
18
src/fileio.c
18
src/fileio.c
@@ -3342,8 +3342,22 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
|
|||||||
}
|
}
|
||||||
else if (reset_changed && whole)
|
else if (reset_changed && whole)
|
||||||
{
|
{
|
||||||
if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
|
int was_changed = curbufIsChanged();
|
||||||
sfname, sfname, FALSE, curbuf, eap)))
|
|
||||||
|
did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
|
||||||
|
sfname, sfname, FALSE, curbuf, eap);
|
||||||
|
if (did_cmd)
|
||||||
|
{
|
||||||
|
if (was_changed && !curbufIsChanged())
|
||||||
|
{
|
||||||
|
/* Written everything correctly and BufWriteCmd has reset
|
||||||
|
* 'modified': Correct the undo information so that an
|
||||||
|
* undo now sets 'modified'. */
|
||||||
|
u_unchanged(curbuf);
|
||||||
|
u_update_save_nr(curbuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
if (overwriting && bt_nofile(curbuf))
|
if (overwriting && bt_nofile(curbuf))
|
||||||
|
@@ -709,6 +709,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
290,
|
||||||
/**/
|
/**/
|
||||||
289,
|
289,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user