]>
Commit | Line | Data |
---|---|---|
3e524028 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.086 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.2.086 | |
11 | Problem: Using ":diffget 1" in buffer 1 corrupts the text. | |
12 | Solution: Don't do anything when source and destination of ":diffget" or | |
13 | ":diffput" is the same buffer. (Dominique Pelle) | |
14 | Files: src/diff.c | |
15 | ||
16 | ||
17 | *** ../vim-7.2.085/src/diff.c Sun Nov 30 15:15:56 2008 | |
18 | --- src/diff.c Wed Jan 14 20:40:25 2009 | |
19 | *************** | |
20 | *** 8,14 **** | |
21 | */ | |
22 | ||
23 | /* | |
24 | ! * diff.c: code for diff'ing two or three buffers. | |
25 | */ | |
26 | ||
27 | #include "vim.h" | |
28 | --- 8,14 ---- | |
29 | */ | |
30 | ||
31 | /* | |
32 | ! * diff.c: code for diff'ing two, three or four buffers. | |
33 | */ | |
34 | ||
35 | #include "vim.h" | |
36 | *************** | |
37 | *** 116,122 **** | |
38 | * Add a buffer to make diffs for. | |
39 | * Call this when a new buffer is being edited in the current window where | |
40 | * 'diff' is set. | |
41 | ! * Marks the current buffer as being part of the diff and requireing updating. | |
42 | * This must be done before any autocmd, because a command may use info | |
43 | * about the screen contents. | |
44 | */ | |
45 | --- 116,122 ---- | |
46 | * Add a buffer to make diffs for. | |
47 | * Call this when a new buffer is being edited in the current window where | |
48 | * 'diff' is set. | |
49 | ! * Marks the current buffer as being part of the diff and requiring updating. | |
50 | * This must be done before any autocmd, because a command may use info | |
51 | * about the screen contents. | |
52 | */ | |
53 | *************** | |
54 | *** 929,935 **** | |
55 | goto theend; | |
56 | ||
57 | #ifdef UNIX | |
58 | ! /* Temporaraly chdir to /tmp, to avoid patching files in the current | |
59 | * directory when the patch file contains more than one patch. When we | |
60 | * have our own temp dir use that instead, it will be cleaned up when we | |
61 | * exit (any .rej files created). Don't change directory if we can't | |
62 | --- 929,935 ---- | |
63 | goto theend; | |
64 | ||
65 | #ifdef UNIX | |
66 | ! /* Temporarily chdir to /tmp, to avoid patching files in the current | |
67 | * directory when the patch file contains more than one patch. When we | |
68 | * have our own temp dir use that instead, it will be cleaned up when we | |
69 | * exit (any .rej files created). Don't change directory if we can't | |
70 | *************** | |
71 | *** 2129,2134 **** | |
72 | --- 2129,2136 ---- | |
73 | EMSG2(_("E102: Can't find buffer \"%s\""), eap->arg); | |
74 | return; | |
75 | } | |
76 | + if (buf == curbuf) | |
77 | + return; /* nothing to do */ | |
78 | idx_other = diff_buf_idx(buf); | |
79 | if (idx_other == DB_COUNT) | |
80 | { | |
81 | *** ../vim-7.2.085/src/version.c Thu Jan 22 18:32:55 2009 | |
82 | --- src/version.c Thu Jan 22 20:46:54 2009 | |
83 | *************** | |
84 | *** 678,679 **** | |
85 | --- 678,681 ---- | |
86 | { /* Add new patch number below this line */ | |
87 | + /**/ | |
88 | + 86, | |
89 | /**/ | |
90 | ||
91 | -- | |
92 | Shift happens. | |
93 | -- Doppler | |
94 | ||
95 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
96 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
97 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
98 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |