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
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0311
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.0311
Problem: Filtering entries in a quickfix list is not easy.
Solution: Add the cfilter plugin. (Yegappan Lakshmanan)
Files: runtime/pack/dist/opt/cfilter/plugin/cfilter.vim,
runtime/doc/quickfix.txt
*** ../vim-8.1.0310/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim 1970-01-01 01:00:00.000000000 +0100
--- runtime/pack/dist/opt/cfilter/plugin/cfilter.vim 2018-08-21 18:56:37.027118962 +0200
***************
*** 0 ****
--- 1,43 ----
+ " cfilter.vim: Plugin to filter entries from a quickfix/location list
+ " Last Change: May 12, 2018
+ " Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
+ " Version: 1.0
+ "
+ " Commands to filter the quickfix list:
+ " :Cfilter[!] {pat}
+ " Create 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[!] {pat}
+ " Same as :Cfilter but operates on the current location list.
+ "
+ if exists("loaded_cfilter")
+ finish
+ endif
+ let loaded_cfilter = 1
+
+ func s:Qf_filter(qf, pat, bang)
+ if a:qf
+ let Xgetlist = function('getqflist')
+ let Xsetlist = function('setqflist')
+ let cmd = ':Cfilter' . a:bang
+ else
+ let Xgetlist = function('getloclist', [0])
+ let Xsetlist = function('setloclist', [0])
+ let cmd = ':Lfilter' . a:bang
+ endif
+
+ if a:bang == '!'
+ let cond = 'v:val.text !~# a:pat && bufname(v:val.bufnr) !~# a:pat'
+ else
+ let cond = 'v:val.text =~# a:pat || bufname(v:val.bufnr) =~# a:pat'
+ endif
+
+ let items = filter(Xgetlist(), cond)
+ let title = cmd . ' ' . a:pat
+ call Xsetlist([], ' ', {'title' : title, 'items' : items})
+ endfunc
+
+ com! -nargs=+ -bang Cfilter call s:Qf_filter(1, <q-args>, <q-bang>)
+ com! -nargs=+ -bang Lfilter call s:Qf_filter(0, <q-args>, <q-bang>)
*** ../vim-8.1.0310/runtime/doc/quickfix.txt 2018-07-08 18:20:18.111521913 +0200
--- runtime/doc/quickfix.txt 2018-08-21 19:02:00.097112470 +0200
***************
*** 1551,1556 ****
--- 1551,1572 ----
recognized as a command separator. The backslash before each space is
required for the set command.
+ *cfilter-plugin*
+ 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*
*** ../vim-8.1.0310/src/version.c 2018-08-21 18:50:11.153501902 +0200
--- src/version.c 2018-08-21 19:01:28.421309486 +0200
***************
*** 796,797 ****
--- 796,799 ----
{ /* Add new patch number below this line */
+ /**/
+ 311,
/**/
--
ARTHUR: Be quiet! I order you to shut up.
OLD WOMAN: Order, eh -- who does he think he is?
ARTHUR: I am your king!
OLD WOMAN: Well, I didn't vote for you.
"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 ///
|