Bram, On So, 13 Mai 2012, Bram Moolenaar wrote:
> > + /* :diffupdate! */ > > + if (eap!=NULL && eap->forceit) > > Spaces around != please. Here is an updated patch: regards, Christian -- Achtung verdient, wer vollbringt, was er vermag. -- Sophokles (496-406 v.Chr.) -- 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
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -178,7 +178,7 @@ nodiff" before hiding it. *:diffu* *:diffupdate* -:diffu[pdate] Update the diff highlighting and folds. +:diffu[pdate][!] Update the diff highlighting and folds. Vim attempts to keep the differences updated when you make changes to the text. This mostly takes care of inserted and deleted lines. Changes within a @@ -187,6 +187,8 @@ :diffupdate +If the ! has been used, Vim will check, if the file needs to be reloaded and +prompt in case the file has been changed externally. Vim will show filler lines for lines that are missing in one window but are present in another. These lines were inserted in another file or deleted in diff --git a/src/diff.c b/src/diff.c --- a/src/diff.c +++ b/src/diff.c @@ -783,6 +783,17 @@ goto theend; } + /* :diffupdate! */ + if (eap != NULL && eap->forceit) + { + for (idx_new = idx_orig; idx_new < DB_COUNT; ++idx_new) + { + buf = curtab->tp_diffbuf[idx_new]; + if (buf_valid(buf)) + buf_check_timestamp(buf, FALSE); + } + } + /* Write the first buffer to a tempfile. */ buf = curtab->tp_diffbuf[idx_orig]; if (diff_write(buf, tmp_orig) == FAIL) diff --git a/src/ex_cmds.h b/src/ex_cmds.h --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -304,7 +304,7 @@ EX(CMD_display, "display", ex_display, EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN), EX(CMD_diffupdate, "diffupdate", ex_diffupdate, - TRLBAR), + BANG|TRLBAR), EX(CMD_diffget, "diffget", ex_diffgetput, RANGE|EXTRA|TRLBAR|MODIFY), EX(CMD_diffoff, "diffoff", ex_diffoff,