summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.2.370
blob: 3e8457e0c47f3c656510eb4b2f7e71c82b21f940 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
To: vim-dev@vim.org
Subject: Patch 7.2.370
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.370 (after 7.2.356)
Problem:    A redraw may cause folds to be closed.
Solution:   Revert part of the previous patch.  Add a test. (Lech Lorens)
Files:	    src/diff.c, src/fold.c, src/option.c, src/testdir/test45.in,
	    src/testdir/test45.ok


*** ../vim-7.2.369/src/diff.c	2009-07-22 16:22:33.000000000 +0200
--- src/diff.c	2010-02-24 14:31:12.000000000 +0100
***************
*** 1117,1142 ****
      win_T	*wp;
      int		addbuf;		/* Add buffer to diff. */
  {
      wp->w_p_diff = TRUE;
      wp->w_p_scb = TRUE;
      wp->w_p_wrap = FALSE;
  # ifdef FEAT_FOLDING
!     {
! 	win_T	    *old_curwin = curwin;
! 
! 	curwin = wp;
! 	curbuf = curwin->w_buffer;
! 	set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
  						       OPT_LOCAL|OPT_FREE, 0);
! 	curwin = old_curwin;
! 	curbuf = curwin->w_buffer;
! 	wp->w_p_fdc = diff_foldcolumn;
! 	wp->w_p_fen = TRUE;
! 	wp->w_p_fdl = 0;
! 	foldUpdateAll(wp);
! 	/* make sure topline is not halfway a fold */
! 	changed_window_setting_win(wp);
!     }
  # endif
  #ifdef FEAT_SCROLLBIND
      if (vim_strchr(p_sbo, 'h') == NULL)
--- 1117,1147 ----
      win_T	*wp;
      int		addbuf;		/* Add buffer to diff. */
  {
+ # ifdef FEAT_FOLDING
+     win_T *old_curwin = curwin;
+ 
+     /* close the manually opened folds */
+     curwin = wp;
+     newFoldLevel();
+     curwin = old_curwin;
+ # endif
+ 
      wp->w_p_diff = TRUE;
      wp->w_p_scb = TRUE;
      wp->w_p_wrap = FALSE;
  # ifdef FEAT_FOLDING
!     curwin = wp;
!     curbuf = curwin->w_buffer;
!     set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
  						       OPT_LOCAL|OPT_FREE, 0);
!     curwin = old_curwin;
!     curbuf = curwin->w_buffer;
!     wp->w_p_fdc = diff_foldcolumn;
!     wp->w_p_fen = TRUE;
!     wp->w_p_fdl = 0;
!     foldUpdateAll(wp);
!     /* make sure topline is not halfway a fold */
!     changed_window_setting_win(wp);
  # endif
  #ifdef FEAT_SCROLLBIND
      if (vim_strchr(p_sbo, 'h') == NULL)
*** ../vim-7.2.369/src/fold.c	2010-02-03 18:14:41.000000000 +0100
--- src/fold.c	2010-02-24 13:09:04.000000000 +0100
***************
*** 854,865 ****
  	    && fp->fd_top < bot)
      {
  	fp->fd_small = MAYBE;
- 
- 	/* Not sure if this is the right place to reset fd_flags (suggested by
- 	 * Lech Lorens). */
-         if (wp->w_foldinvalid)
-             fp->fd_flags = FD_LEVEL;
- 
  	++fp;
      }
  
--- 854,859 ----
*** ../vim-7.2.369/src/option.c	2010-02-11 17:02:04.000000000 +0100
--- src/option.c	2010-02-24 13:09:44.000000000 +0100
***************
*** 6586,6592 ****
--- 6586,6596 ----
  		|| *curwin->w_p_fdm == NUL)
  	    errmsg = e_invarg;
  	else
+ 	{
  	    foldUpdateAll(curwin);
+ 	    if (foldmethodIsDiff(curwin))
+ 		newFoldLevel();
+ 	}
      }
  # ifdef FEAT_EVAL
      /* 'foldexpr' */
*** ../vim-7.2.369/src/testdir/test45.in	2009-11-03 14:46:35.000000000 +0100
--- src/testdir/test45.in	2010-02-24 13:02:39.000000000 +0100
***************
*** 36,41 ****
--- 36,43 ----
  k:call append("$", getline("."))
  jAcommentstart  Acommentend:set fdl=1
  3j:call append("$", getline("."))
+ :set fdl=0
+ zOj:call append("$", getline("."))
  :" test expression folding
  :fun Flvl()
    let l = getline(v:lnum)
*** ../vim-7.2.369/src/testdir/test45.ok	2009-11-03 14:46:35.000000000 +0100
--- src/testdir/test45.ok	2010-02-24 12:58:55.000000000 +0100
***************
*** 11,16 ****
--- 11,17 ----
  folding 9 ii
      3 cc
  7 gg
+ 8 hh
  expr 2
  1
  2
*** ../vim-7.2.369/src/version.c	2010-02-24 13:59:09.000000000 +0100
--- src/version.c	2010-02-24 14:28:20.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     370,
  /**/

-- 
MAN:    Fetchez la vache!
GUARD:  Quoi?
MAN:    Fetchez la vache!
                 "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/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///