diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-05-18 18:47:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-05-18 18:47:17 +0200 |
commit | bd1d5608952dd1c61f99f9b2f605610405415622 (patch) | |
tree | 20c04b0c33df0d916164a1193c6db3a3419d11ed | |
parent | 455981e69bcef65ef96ecf6b0a27810b585fc9d9 (diff) | |
download | vim-git-bd1d5608952dd1c61f99f9b2f605610405415622.tar.gz |
updated for version 7.3.523v7.3.523
Problem: ":diffupdate" doesn't check for files changed elsewhere.
Solution: Add the ! flag. (Christian Brabandt)
-rw-r--r-- | runtime/doc/diff.txt | 5 | ||||
-rw-r--r-- | src/diff.c | 9 | ||||
-rw-r--r-- | src/ex_cmds.h | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 16 insertions, 2 deletions
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 288ddd78a..bf40afa88 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -178,7 +178,7 @@ buffer. If you don't want a buffer to remain used for the diff do ":set 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,9 @@ To force the differences to be updated use: > :diffupdate +If the ! is included Vim will check if the file was changed externally and +needs to be reloaded. It will prompt for each changed file, like `:checktime` +was used. 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 index 5844ec923..d9aaec828 100644 --- a/src/diff.c +++ b/src/diff.c @@ -783,6 +783,15 @@ ex_diffupdate(eap) 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 index 16540bda0..ac61f1a0a 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -304,7 +304,7 @@ EX(CMD_delfunction, "delfunction", ex_delfunction, 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, diff --git a/src/version.c b/src/version.c index 0c866c5ec..82672b1d1 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 523 +/**/ 522, /**/ 521, |