File tree 1 file changed +19
-3
lines changed
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -253,11 +253,27 @@ endfunction
253
253
254
254
255
255
" modify from someone's .vimrc
256
- function ! codequery#filter_qf_results (query) abort
256
+ function ! codequery#filter_qf_results (args ) abort
257
+ let args = split (a: args , ' ' )
258
+ if len (args ) > 1
259
+ let query = args [1 ]
260
+ let reverse_filter = 1
261
+ else
262
+ let query = args [0 ]
263
+ let reverse_filter = 0
264
+ endif
265
+ echom query
266
+
257
267
let results = getqflist ()
258
268
for d in results
259
- if bufname (d [' bufnr' ]) !~ a: query && d [' text' ] !~ a: query
260
- call remove (results, index (results, d ))
269
+ if reverse_filter
270
+ if bufname (d [' bufnr' ]) = ~ query || d [' text' ] = ~ query
271
+ call remove (results, index (results, d ))
272
+ endif
273
+ else
274
+ if bufname (d [' bufnr' ]) !~ query && d [' text' ] !~ query
275
+ call remove (results, index (results, d ))
276
+ endif
261
277
endif
262
278
endfor
263
279
call setqflist (results)
You can’t perform that action at this time.
0 commit comments