summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0449
blob: c5d31defabd0ac29773b3770387c059c2adcfa70 (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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0449
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.0449
Problem:    When 'rnu' is set folded lines are not displayed correctly.
            (Vitaly Yashin)
Solution:   When only redrawing line numbers do draw folded lines.
            (closes #3484)
Files:	    src/screen.c, src/testdir/test_fold.vim,
            src/testdir/dumps/Test_folds_with_rnu_01.dump,
            src/testdir/dumps/Test_folds_with_rnu_02.dump


*** ../vim-8.1.0448/src/screen.c	2018-09-30 21:43:17.203693237 +0200
--- src/screen.c	2018-10-02 21:17:41.161356069 +0200
***************
*** 2176,2182 ****
  	    {
  		// 'relativenumber' set: The text doesn't need to be drawn, but
  		// the number column nearly always does.
! 		(void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE);
  	    }
  
  	    // This line does not need to be drawn, advance to the next one.
--- 2176,2189 ----
  	    {
  		// 'relativenumber' set: The text doesn't need to be drawn, but
  		// the number column nearly always does.
! 		fold_count = foldedCount(wp, lnum, &win_foldinfo);
! 		if (fold_count != 0)
! 		{
! 		    fold_line(wp, fold_count, &win_foldinfo, lnum, row);
! 		    --fold_count;
! 		}
! 		else
! 		    (void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE);
  	    }
  
  	    // This line does not need to be drawn, advance to the next one.
***************
*** 3315,3322 ****
  	    has_spell = TRUE;
  	    extra_check = TRUE;
  
! 	    /* Get the start of the next line, so that words that wrap to the next
! 	     * line are found too: "et<line-break>al.".
  	     * Trick: skip a few chars for C/shell/Vim comments */
  	    nextline[SPWORDLEN] = NUL;
  	    if (lnum < wp->w_buffer->b_ml.ml_line_count)
--- 3322,3329 ----
  	    has_spell = TRUE;
  	    extra_check = TRUE;
  
! 	    /* Get the start of the next line, so that words that wrap to the
! 	     * next line are found too: "et<line-break>al.".
  	     * Trick: skip a few chars for C/shell/Vim comments */
  	    nextline[SPWORDLEN] = NUL;
  	    if (lnum < wp->w_buffer->b_ml.ml_line_count)
***************
*** 3325,3332 ****
  		spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN);
  	    }
  
! 	    /* When a word wrapped from the previous line the start of the current
! 	     * line is valid. */
  	    if (lnum == checked_lnum)
  		cur_checked_col = checked_col;
  	    checked_lnum = 0;
--- 3332,3339 ----
  		spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN);
  	    }
  
! 	    /* When a word wrapped from the previous line the start of the
! 	     * current line is valid. */
  	    if (lnum == checked_lnum)
  		cur_checked_col = checked_col;
  	    checked_lnum = 0;
*** ../vim-8.1.0448/src/testdir/test_fold.vim	2018-07-10 15:07:11.779668824 +0200
--- src/testdir/test_fold.vim	2018-10-02 21:15:55.182278183 +0200
***************
*** 1,6 ****
--- 1,7 ----
  " Test for folding
  
  source view_util.vim
+ source screendump.vim
  
  func PrepIndent(arg)
    return [a:arg] + repeat(["\t".a:arg], 5)
***************
*** 674,676 ****
--- 675,697 ----
    set fdm&
    enew!
  endfunc
+ 
+ func Test_folds_with_rnu()
+   if !CanRunVimInTerminal()
+     return
+   endif
+ 
+   call writefile([
+ 	\ 'set fdm=marker rnu foldcolumn=2',
+ 	\ 'call setline(1, ["{{{1", "nline 1", "{{{1", "line 2"])',
+ 	\ ], 'Xtest_folds_with_rnu')
+   let buf = RunVimInTerminal('-S Xtest_folds_with_rnu', {})
+ 
+   call VerifyScreenDump(buf, 'Test_folds_with_rnu_01', {})
+   call term_sendkeys(buf, "j")
+   call VerifyScreenDump(buf, 'Test_folds_with_rnu_02', {})
+ 
+   " clean up
+   call StopVimInTerminal(buf)
+   call delete('Xtest_folds_with_rnu')
+ endfunc
*** ../vim-8.1.0448/src/testdir/dumps/Test_folds_with_rnu_01.dump	2018-10-02 21:19:43.940299759 +0200
--- src/testdir/dumps/Test_folds_with_rnu_01.dump	2018-10-02 21:16:04.846193642 +0200
***************
*** 0 ****
--- 1,20 ----
+ |++0#0000e05#a8a8a8255| @2|0| >+|-@1| @1|2| |l|i|n|e|s|:| |-@54
+ |+| @2|1| |+|-@1| @1|2| |l|i|n|e|s|:| |-@54
+ | @1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000000&@56|1|,|1| @10|A|l@1| 
*** ../vim-8.1.0448/src/testdir/dumps/Test_folds_with_rnu_02.dump	2018-10-02 21:19:43.944299727 +0200
--- src/testdir/dumps/Test_folds_with_rnu_02.dump	2018-10-02 21:16:05.894184479 +0200
***************
*** 0 ****
--- 1,20 ----
+ |++0#0000e05#a8a8a8255| @2|1| |+|-@1| @1|2| |l|i|n|e|s|:| |-@54
+ |+| @2|0| >+|-@1| @1|2| |l|i|n|e|s|:| |-@54
+ | @1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000e05#a8a8a8255@1|~+0#4040ff13#ffffff0| @71
+ | +0#0000000&@56|3|,|1| @10|A|l@1| 
*** ../vim-8.1.0448/src/version.c	2018-10-02 18:25:41.424867560 +0200
--- src/version.c	2018-10-02 21:18:46.028796562 +0200
***************
*** 794,795 ****
--- 794,797 ----
  {   /* Add new patch number below this line */
+ /**/
+     449,
  /**/

-- 
The coffee just wasn't strong enough to defend itself -- Tom Waits

 /// 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    ///