ag.vim icon indicating copy to clipboard operation
ag.vim copied to clipboard

Add posfilter processor

Open albfan opened this issue 10 years ago • 4 comments

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)

albfan avatar Sep 12 '15 16:09 albfan

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)

albfan avatar Dec 11 '15 08:12 albfan

Related to #36 and #34. Maybe split-recombine all those ideas will help to refine interface.

amerlyq avatar Dec 30 '15 00:12 amerlyq

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

albfan avatar Jan 11 '16 01:01 albfan

With 5f3ea8d place to put this is mostly defined.

Instead of an IgnorePattern, this match patterns will work finding callers/callees or similar

albfan avatar Jan 31 '22 10:01 albfan