summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0535
blob: 02192da413daf9acb8d29af88bcd7c52c9eaa2ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0535
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0535
Problem:    Increment/decrement might get interrupted by updating folds.
Solution:   Disable fold updating for a moment. (Christian Brabandt,
            closes #3599)
Files:	    src/ops.c


*** ../vim-8.1.0534/src/ops.c	2018-09-30 21:43:17.199693265 +0200
--- src/ops.c	2018-11-16 20:30:45.414309325 +0100
***************
*** 5549,5560 ****
--- 5549,5575 ----
      int			change_cnt = 0;
      linenr_T		amount = Prenum1;
  
+    // do_addsub() might trigger re-evaluation of 'foldexpr' halfway, when the
+    // buffer is not completly updated yet. Postpone updating folds until before
+    // the call to changed_lines().
+ #ifdef FEAT_FOLDING
+    disable_fold_update++;
+ #endif
+ 
      if (!VIsual_active)
      {
  	pos = curwin->w_cursor;
  	if (u_save_cursor() == FAIL)
+ 	{
+ #ifdef FEAT_FOLDING
+ 	    disable_fold_update--;
+ #endif
  	    return;
+ 	}
  	change_cnt = do_addsub(oap->op_type, &pos, 0, amount);
+ #ifdef FEAT_FOLDING
+ 	disable_fold_update--;
+ #endif
  	if (change_cnt)
  	    changed_lines(pos.lnum, 0, pos.lnum + 1, 0L);
      }
***************
*** 5566,5572 ****
--- 5581,5592 ----
  
  	if (u_save((linenr_T)(oap->start.lnum - 1),
  					(linenr_T)(oap->end.lnum + 1)) == FAIL)
+ 	{
+ #ifdef FEAT_FOLDING
+ 	    disable_fold_update--;
+ #endif
  	    return;
+ 	}
  
  	pos = oap->start;
  	for (; pos.lnum <= oap->end.lnum; ++pos.lnum)
***************
*** 5624,5629 ****
--- 5644,5653 ----
  	    if (g_cmd && one_change)
  		amount += Prenum1;
  	}
+ 
+ #ifdef FEAT_FOLDING
+ 	disable_fold_update--;
+ #endif
  	if (change_cnt)
  	    changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
  
*** ../vim-8.1.0534/src/version.c	2018-11-16 19:39:47.350937378 +0100
--- src/version.c	2018-11-16 20:54:05.109734642 +0100
***************
*** 794,795 ****
--- 794,797 ----
  {   /* Add new patch number below this line */
+ /**/
+     535,
  /**/

-- 
ARTHUR:   Ni!
BEDEVERE: Nu!
ARTHUR:   No.  Ni!  More like this. "Ni"!
BEDEVERE: Ni, ni, ni!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///