aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-19 11:53:59 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-19 11:53:59 +1200
commita09bdbb9f30670e6cdf571ac95ebee87d6f0ab32 (patch)
treee4c9da3bd032712e1de600406274d741b3076671 /autoload
parentMerge branch 'release/v2.1.0' into develop (diff)
downloadvim-quickfix-auto-open-a09bdbb9f30670e6cdf571ac95ebee87d6f0ab32.tar.gz
vim-quickfix-auto-open-a09bdbb9f30670e6cdf571ac95ebee87d6f0ab32.zip
Refactor to avoid autoloading :lhelpgrep handler
Diffstat (limited to 'autoload')
-rw-r--r--autoload/quickfix_auto_open.vim11
1 files changed, 4 insertions, 7 deletions
diff --git a/autoload/quickfix_auto_open.vim b/autoload/quickfix_auto_open.vim
index c578d0c..a190c34 100644
--- a/autoload/quickfix_auto_open.vim
+++ b/autoload/quickfix_auto_open.vim
@@ -1,5 +1,5 @@
-" Handle a quickfix command
-function! quickfix_auto_open#(command) abort
+" Handle a local quickfix command
+function! quickfix_auto_open#Local(command) abort
" The only difficult quickfix command to handle is :lhelpgrep, because it
" uses the location list not for the current window but for a :help window,
@@ -12,14 +12,11 @@ function! quickfix_auto_open#(command) abort
" it to check its location and the presence of a location list, and open
" it up if so; then remove the hook
autocmd quickfix_auto_open BufEnter *
- \ call s:Help(bufnr('%'))
- \|autocmd! quickfix_auto_open BufEnter
+ \ call s:Help(bufnr('%')) | autocmd! quickfix_auto_open BufEnter
" All of the rest of the commands are really easy:
- elseif a:command =~# '^l'
- lwindow " Command started with 'l', open this window's location list
else
- cwindow " Command didn't start with 'l', open the quickfix list
+ lwindow
endif
endfunction