Add posfilter processor
Except for sparse searches, many times a search has an underliying pattern.
e.g. When searching "Foo" relating "function Foo" you may want to include only matches with "function" (search function definition) or exclude them (search function calls)
This feature aim to a plugin feature for ag.vim. A supposed implementation for definitions/callings:
- based on filetype, define a pattern to search callers and callees
- Activate postfilter
- Activate option (definition or callings)
- Do searchs
- Ease regular basis operation (Using unite, or some shortcut or custom functions)
Related to #36 and #34. Maybe split-recombine all those ideas will help to refine interface.
Use g:ag to define postprocesor variable. It will be a function which process each line and returns the filtered result.
e.g: pseudocode Implementation for definition/callings on vimL:
- Add a handler to AgSet or AgToggle
- Detect enable or disable to g:ag.callers or g:ag.callees with third party plugin which adds a postprocessor (can be only one var but this way seems more clear)
- postprocesor function filters lines with
fu.*<search>at start (for definition), and not start with fu for callings
With 5f3ea8d place to put this is mostly defined.
Instead of an IgnorePattern, this match patterns will work finding callers/callees or similar