rking/ag.vim — pull request #30 by joshuarh (2013-12-13 18:54:39+00:00)
Title: Use the quickfix/location list height in `gv`

Before this was just being set to something similar to the default
height. Though this code is harder to read, it fixes the following:
- Close the right list (the location list or the quickfix window). This
is fixed for the `e` and `q` commands too.
- If someone specifies a height (e.g. `let g:ag_qhandler="copen 50"`)
then `gv` will be less jarring because when the quickfix window is
re-opened it'll be 50 lines again.

The `gv`, `e`, and `q` mappings depended on a local variable that won't
be available when the mapping was used, so |:execute| was used for those
mappings to evaluate that variable when the mappings are made.

Fixes #11

Thanks to @sigmavirus24 for helping out with this one :)