summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1281
blob: 41204b8419924fdaecd791aa21458a3f051f0286 (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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1281
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.1281
Problem:    Cannot specify a count with :chistory.
Solution:   Add a count to :chistory and :lhistory. (Yegappan Lakshmanan,
            closes #4344)
Files:	    runtime/doc/quickfix.txt,  src/ex_cmds.h,  src/quickfix.c,
            src/testdir/test_quickfix.vim


*** ../vim-8.1.1280/runtime/doc/quickfix.txt	2019-05-05 18:11:46.320590639 +0200
--- runtime/doc/quickfix.txt	2019-05-05 20:51:22.585954153 +0200
***************
*** 139,146 ****
  :[count]lab[ove]	Same as ":cabove", except the location list for the
  			current window is used instead of the quickfix list.
  
! 							*:cbe* *:cbelow*
! :[count]cbe[low]	Go to the [count] error below the current line in the
  			current buffer.  If [count] is omitted, then 1 is
  			used.  If there are no errors, then an error message
  			is displayed.  Assumes that the entries in a quickfix
--- 139,146 ----
  :[count]lab[ove]	Same as ":cabove", except the location list for the
  			current window is used instead of the quickfix list.
  
! 							*:cbel* *:cbelow*
! :[count]cbel[ow]	Go to the [count] error below the current line in the
  			current buffer.  If [count] is omitted, then 1 is
  			used.  If there are no errors, then an error message
  			is displayed.  Assumes that the entries in a quickfix
***************
*** 164,171 ****
  			number of entries before the current position, then
  			the first error in the file is selected.
  
! 							*:lbef* *:lbefore*
! :[count]lbef[ore]	Same as ":cbefore", except the location list for the
  			current window is used instead of the quickfix list.
  
  							*:caf* *:cafter*
--- 164,171 ----
  			number of entries before the current position, then
  			the first error in the file is selected.
  
! 							*:lbe* *:lbefore*
! :[count]lbe[fore]	Same as ":cbefore", except the location list for the
  			current window is used instead of the quickfix list.
  
  							*:caf* *:cafter*
***************
*** 536,541 ****
--- 536,564 ----
  				etc.
  <			Otherwise it works the same as `:ldo`.
  
+ FILTERING A QUICKFIX OR LOCATION LIST:
+ 				    *cfilter-plugin* *:Cfilter* *:Lfilter*
+ If you have too many entries in a quickfix list, you can use the cfilter
+ plugin to reduce the number of entries.  Load the plugin with: >
+ 
+     packadd cfilter
+ 
+ Then you can use the following commands to filter a quickfix/location list: >
+ 
+     :Cfilter[!] /{pat}/
+     :Lfilter[!] /{pat}/
+ 
+ The |:Cfilter| command creates a new quickfix list from the entries matching
+ {pat} in the current quickfix list. {pat} is a Vim |regular-expression|
+ pattern. Both the file name and the text of the entries are matched against
+ {pat}. If the optional ! is supplied, then the entries not matching {pat} are
+ used. The pattern can be optionally enclosed using one of the following
+ characters: ', ", /. If the pattern is empty, then the last used search
+ pattern is used.
+ 
+ The |:Lfilter| command does the same as |:Cfilter| but operates on the current
+ location list.
+ 
  =============================================================================
  2. The error window					*quickfix-window*
  
***************
*** 822,835 ****
  			the current window instead of the quickfix list.
  
  						*:chistory* *:chi*
! :chi[story]		Show the list of error lists.  The current list is
  			marked with ">".  The output looks like:
  				  error list 1 of 3; 43 errors ~
  				> error list 2 of 3; 0 errors ~
  				  error list 3 of 3; 15 errors ~
  
  						*:lhistory* *:lhi*
! :lhi[story]		Show the list of location lists, otherwise like
  			`:chistory`.
  
  When adding a new error list, it becomes the current list.
--- 845,863 ----
  			the current window instead of the quickfix list.
  
  						*:chistory* *:chi*
! :[count]chi[story]	Show the list of error lists.  The current list is
  			marked with ">".  The output looks like:
  				  error list 1 of 3; 43 errors ~
  				> error list 2 of 3; 0 errors ~
  				  error list 3 of 3; 15 errors ~
  
+ 			When [count] is given, then the count'th quickfix
+ 			list is made the current list. Example: >
+ 				" Make the 4th quickfix list current
+ 				:4chistory
+ <
  						*:lhistory* *:lhi*
! :[count]lhi[story]	Show the list of location lists, otherwise like
  			`:chistory`.
  
  When adding a new error list, it becomes the current list.
***************
*** 1641,1662 ****
  recognized as a command separator.  The backslash before each space is
  required for the set command.
  
- 				    *cfilter-plugin* *:Cfilter* *:Lfilter*
- If you have too many matching messages, you can use the cfilter plugin to
- reduce the number of entries.  Load the plugin with: >
-    packadd cfilter
- 
- Then you can use these command: >
-    :Cfilter[!] /{pat}/
-    :Lfilter[!] /{pat}/
- 
- :Cfilter creates a new quickfix list from entries matching {pat} in the
- current quickfix list. Both the file name and the text of the entries are
- matched against {pat}. If ! is supplied, then entries not matching {pat} are
- used.
- 
- :Lfilter does the same as :Cfilter but operates on the current location list.
- 
  =============================================================================
  8. The directory stack				*quickfix-directory-stack*
  
--- 1669,1674 ----
*** ../vim-8.1.1280/src/ex_cmds.h	2019-05-05 15:02:26.176319819 +0200
--- src/ex_cmds.h	2019-05-05 20:48:37.758956072 +0200
***************
*** 336,343 ****
  			RANGE|BUFNAME|COUNT|EXTRA|TRLBAR,
  			ADDR_OTHER),
  EX(CMD_chistory,	"chistory",	qf_history,
! 			TRLBAR,
! 			ADDR_NONE),
  EX(CMD_clist,		"clist",	qf_list,
  			BANG|EXTRA|TRLBAR|CMDWIN,
  			ADDR_NONE),
--- 336,343 ----
  			RANGE|BUFNAME|COUNT|EXTRA|TRLBAR,
  			ADDR_OTHER),
  EX(CMD_chistory,	"chistory",	qf_history,
! 			RANGE|COUNT|TRLBAR,
! 			ADDR_UNSIGNED),
  EX(CMD_clist,		"clist",	qf_list,
  			BANG|EXTRA|TRLBAR|CMDWIN,
  			ADDR_NONE),
***************
*** 828,835 ****
  			EXTRA|NOTRLCOM|NEEDARG,
  			ADDR_NONE),
  EX(CMD_lhistory,	"lhistory",	qf_history,
! 			TRLBAR,
! 			ADDR_NONE),
  EX(CMD_ll,		"ll",		ex_cc,
  			RANGE|COUNT|TRLBAR|BANG,
  			ADDR_QUICKFIX),
--- 828,835 ----
  			EXTRA|NOTRLCOM|NEEDARG,
  			ADDR_NONE),
  EX(CMD_lhistory,	"lhistory",	qf_history,
! 			RANGE|COUNT|TRLBAR,
! 			ADDR_UNSIGNED),
  EX(CMD_ll,		"ll",		ex_cc,
  			RANGE|COUNT|TRLBAR|BANG,
  			ADDR_QUICKFIX),
*** ../vim-8.1.1280/src/quickfix.c	2019-05-05 15:02:26.180319795 +0200
--- src/quickfix.c	2019-05-05 20:48:37.762956047 +0200
***************
*** 3742,3747 ****
--- 3742,3768 ----
      qf_info_T	*qi = qf_cmd_get_stack(eap, FALSE);
      int		i;
  
+     if (eap->addr_count > 0)
+     {
+ 	if (qi == NULL)
+ 	{
+ 	    emsg(_(e_loclist));
+ 	    return;
+ 	}
+ 
+ 	// Jump to the specified quickfix list
+ 	if (eap->line2 > 0 && eap->line2 <= qi->qf_listcount)
+ 	{
+ 	    qi->qf_curlist = eap->line2 - 1;
+ 	    qf_msg(qi, qi->qf_curlist, "");
+ 	    qf_update_buffer(qi, NULL);
+ 	}
+ 	else
+ 	    emsg(_(e_invrange));
+ 
+ 	return;
+     }
+ 
      if (qf_stack_empty(qi))
  	msg(_("No entries"));
      else
*** ../vim-8.1.1280/src/testdir/test_quickfix.vim	2019-05-05 15:02:26.180319795 +0200
--- src/testdir/test_quickfix.vim	2019-05-05 20:48:37.762956047 +0200
***************
*** 1831,1839 ****
--- 1831,1853 ----
    call assert_equal('  error list 2 of 3; 2 ' . common, res[1])
    call assert_equal('> error list 3 of 3; 3 ' . common, res[2])
  
+   " Test for changing the quickfix lists
+   call assert_equal(3, g:Xgetlist({'nr' : 0}).nr)
+   exe '1' . a:cchar . 'hist'
+   call assert_equal(1, g:Xgetlist({'nr' : 0}).nr)
+   exe '3' . a:cchar . 'hist'
+   call assert_equal(3, g:Xgetlist({'nr' : 0}).nr)
+   call assert_fails('-2' . a:cchar . 'hist', 'E16:')
+   call assert_fails('4' . a:cchar . 'hist', 'E16:')
+ 
    call g:Xsetlist([], 'f')
    let l = split(execute(a:cchar . 'hist'), "\n")
    call assert_equal('No entries', l[0])
+   if a:cchar == 'c'
+     call assert_fails('4chist', 'E16:')
+   else
+     call assert_fails('4lhist', 'E776:')
+   endif
  
    " An empty list should still show the stack history
    call g:Xsetlist([])
*** ../vim-8.1.1280/src/version.c	2019-05-05 18:11:46.336590548 +0200
--- src/version.c	2019-05-05 20:59:35.150902389 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1281,
  /**/

-- 
Every exit is an entrance into something else.

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