]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.703
- add patches 7.3.619-743
[packages/vim.git] / 7.3.703
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.703
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.703
11 Problem:    When 'undofile' is reset the hash is computed unnecessarily.
12 Solution:   Only compute the hash when the option was set. (Christian Brabandt)
13 Files:      src/option.c
14
15
16 *** ../vim-7.3.702/src/option.c 2012-10-21 00:10:29.000000000 +0200
17 --- src/option.c        2012-10-21 03:42:10.000000000 +0200
18 ***************
19 *** 7573,7596 ****
20       /* 'undofile' */
21       else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf)
22       {
23 !       char_u  hash[UNDO_HASH_SIZE];
24 !       buf_T   *save_curbuf = curbuf;
25
26 !       for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
27         {
28 !           /* When 'undofile' is set globally: for every buffer, otherwise
29 !            * only for the current buffer: Try to read in the undofile, if
30 !            * one exists and the buffer wasn't changed and the buffer was
31 !            * loaded. */
32 !           if ((curbuf == save_curbuf
33 !                               || (opt_flags & OPT_GLOBAL) || opt_flags == 0)
34 !                   && !curbufIsChanged() && curbuf->b_ml.ml_mfp != NULL)
35             {
36 !               u_compute_hash(hash);
37 !               u_read_undo(NULL, hash, curbuf->b_fname);
38             }
39         }
40 -       curbuf = save_curbuf;
41       }
42   #endif
43   
44 --- 7573,7602 ----
45       /* 'undofile' */
46       else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf)
47       {
48 !       /* Only take action when the option was set. When reset we do not
49 !        * delete the undo file, the option may be set again without making
50 !        * any changes in between. */
51 !       if (curbuf->b_p_udf || p_udf)
52         {
53 !           char_u      hash[UNDO_HASH_SIZE];
54 !           buf_T       *save_curbuf = curbuf;
55
56 !           for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
57             {
58 !               /* When 'undofile' is set globally: for every buffer, otherwise
59 !                * only for the current buffer: Try to read in the undofile,
60 !                * if one exists, the buffer wasn't changed and the buffer was
61 !                * loaded */
62 !               if ((curbuf == save_curbuf
63 !                               || (opt_flags & OPT_GLOBAL) || opt_flags == 0)
64 !                       && !curbufIsChanged() && curbuf->b_ml.ml_mfp != NULL)
65 !               {
66 !                   u_compute_hash(hash);
67 !                   u_read_undo(NULL, hash, curbuf->b_fname);
68 !               }
69             }
70 +           curbuf = save_curbuf;
71         }
72       }
73   #endif
74   
75 *** ../vim-7.3.702/src/version.c        2012-10-21 02:41:04.000000000 +0200
76 --- src/version.c       2012-10-21 03:43:29.000000000 +0200
77 ***************
78 *** 721,722 ****
79 --- 721,724 ----
80   {   /* Add new patch number below this line */
81 + /**/
82 +     703,
83   /**/
84
85 -- 
86 Scientists decoded the first message from an alien civilization:
87         SIMPLY SEND 6 TIMES 10 TO THE 50 ATOMS OF HYDROGEN TO THE STAR
88 SYSTEM AT THE TOP OF THE LIST, CROSS OFF THAT STAR SYSTEM, THEN PUT
89 YOUR STAR SYSTEM AT THE BOTTOM OF THE LIST AND SEND IT TO 100 OTHER
90 STAR SYSTEMS.  WITHIN ONE TENTH GALACTIC ROTATION YOU WILL RECEIVE
91 ENOUGH HYDROGREN TO POWER YOUR CIVILIZATION UNTIL ENTROPY REACHES ITS
92 MAXIMUM!  IT REALLY WORKS!
93
94  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
95 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
96 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
97  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.095583 seconds and 3 git commands to generate.