]>
Commit | Line | Data |
---|---|---|
d034a75d AG |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.392 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.3.392 | |
11 | Problem: When setting 'undofile' while the file is already loaded but | |
12 | unchanged, try reading the undo file. (Andy Wokula) | |
13 | Solution: Compute a checksum of the text when 'undofile' is set. (Christian | |
14 | Brabandt) | |
15 | Files: src/option.c, src/testdir/test72.in, src/testdir/test72.ok | |
16 | ||
17 | ||
18 | *** ../vim-7.3.391/src/option.c 2011-11-30 11:31:25.000000000 +0100 | |
19 | --- src/option.c 2012-01-04 19:34:11.000000000 +0100 | |
20 | *************** | |
21 | *** 7516,7521 **** | |
22 | --- 7516,7545 ---- | |
23 | compatible_set(); | |
24 | } | |
25 | ||
26 | + #ifdef FEAT_PERSISTENT_UNDO | |
27 | + /* 'undofile' */ | |
28 | + else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf) | |
29 | + { | |
30 | + char_u hash[UNDO_HASH_SIZE]; | |
31 | + buf_T *save_curbuf = curbuf; | |
32 | + | |
33 | + for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next) | |
34 | + { | |
35 | + /* When 'undofile' is set globally: for every buffer, otherwise | |
36 | + * only for the current buffer: Try to read in the undofile, if | |
37 | + * one exists and the buffer wasn't changed. */ | |
38 | + if ((curbuf == save_curbuf | |
39 | + || (opt_flags & OPT_GLOBAL) || opt_flags == 0) | |
40 | + && !curbufIsChanged()) | |
41 | + { | |
42 | + u_compute_hash(hash); | |
43 | + u_read_undo(NULL, hash, curbuf->b_fname); | |
44 | + } | |
45 | + } | |
46 | + curbuf = save_curbuf; | |
47 | + } | |
48 | + #endif | |
49 | + | |
50 | /* 'list', 'number' */ | |
51 | else if ((int *)varp == &curwin->w_p_list | |
52 | || (int *)varp == &curwin->w_p_nu | |
53 | *** ../vim-7.3.391/src/testdir/test72.in 2010-08-15 21:57:29.000000000 +0200 | |
54 | --- src/testdir/test72.in 2012-01-04 19:04:17.000000000 +0100 | |
55 | *************** | |
56 | *** 51,56 **** | |
57 | --- 51,62 ---- | |
58 | :e Xtestfile | |
59 | uuu:w >>test.out | |
60 | :" | |
61 | + :" Test that reading the undofiles when setting undofile works | |
62 | + :set noundofile ul=0 | |
63 | + i | |
64 | + \eu:e! Xtestfile | |
65 | + :set undofile ul=100 | |
66 | + uuuuuu:w >>test.out | |
67 | :" And now with encryption, cryptmethod=zip | |
68 | :e! Xtestfile | |
69 | :set undofile cm=zip | |
70 | *** ../vim-7.3.391/src/testdir/test72.ok 2010-08-15 21:57:29.000000000 +0200 | |
71 | --- src/testdir/test72.ok 2012-01-04 19:04:17.000000000 +0100 | |
72 | *************** | |
73 | *** 7,12 **** | |
74 | --- 7,22 ---- | |
75 | eight | |
76 | nine | |
77 | ten | |
78 | + one | |
79 | + two | |
80 | + three | |
81 | + four | |
82 | + five | |
83 | + six | |
84 | + seven | |
85 | + eight | |
86 | + nine | |
87 | + ten | |
88 | monday | |
89 | wednesday | |
90 | thursday | |
91 | *** ../vim-7.3.391/src/version.c 2012-01-04 14:35:31.000000000 +0100 | |
92 | --- src/version.c 2012-01-04 19:33:41.000000000 +0100 | |
93 | *************** | |
94 | *** 716,717 **** | |
95 | --- 716,719 ---- | |
96 | { /* Add new patch number below this line */ | |
97 | + /**/ | |
98 | + 392, | |
99 | /**/ | |
100 | ||
101 | -- | |
102 | BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One. | |
103 | ANOTHER MONK: And St. Attila raised his hand grenade up on high saying "O | |
104 | Lord bless this thy hand grenade that with it thou mayest | |
105 | blow thine enemies to tiny bits, in thy mercy. "and the Lord | |
106 | did grin and people did feast upon the lambs and sloths and | |
107 | carp and anchovies and orang-utans and breakfast cereals and | |
108 | fruit bats and... | |
109 | BROTHER MAYNARD: Skip a bit brother ... | |
110 | "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD | |
111 | ||
112 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
113 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
114 | \\\ an exciting new programming language -- http://www.Zimbu.org /// | |
115 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |