diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 22:29:05 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-25 22:29:05 +1200 |
commit | 0b642ea72474f289ce463b2ddc3fdb104f0abdf7 (patch) | |
tree | c3009d441ab19474c3a17f945016092390126b22 | |
parent | Merge branch 'release/v0.3.0' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-quickfix-auto-open-0b642ea72474f289ce463b2ddc3fdb104f0abdf7.tar.gz vim-quickfix-auto-open-0b642ea72474f289ce463b2ddc3fdb104f0abdf7.zip |
Merge branch 'release/v1.0.0'v1.0.0
* release/v1.0.0:
Simplify back to romainl's original commands
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | doc/quickfix_auto_open.txt | 11 | ||||
-rw-r--r-- | plugin/quickfix_auto_open.vim | 46 |
3 files changed, 11 insertions, 48 deletions
@@ -1 +1 @@ -0.3.0 +1.0.0 diff --git a/doc/quickfix_auto_open.txt b/doc/quickfix_auto_open.txt index 8d2a083..553de9d 100644 --- a/doc/quickfix_auto_open.txt +++ b/doc/quickfix_auto_open.txt @@ -1,4 +1,4 @@ -*quickfix_auto_open.txt* For Vim version 7.0 Last change: 2018 Dec 28 +*quickfix_auto_open.txt* For Vim version 7.0 Last change: 2019 May 25 DESCRIPTION *quickfix_auto_open* @@ -12,13 +12,8 @@ the |+autocmd| feature. AUTHOR *quickfix_auto_open-author* -The original commands that do essentially all of this come from Romain -Lafourcade (romainl)'s "minivimrc" project on GitHub: -<https://github.com/romainl/minivimrc> - -Tom Ryder (tejr) extended them just a bit to handle the slightly different -behavior of |:lhelpgrep|, and packaged and documented them for this -distribution. +The original commands are from Romain Lafourcade (romainl)'s "minivimrc" +project on GitHub: <https://github.com/romainl/minivimrc> LICENSE *quickfix_auto_open-license* diff --git a/plugin/quickfix_auto_open.vim b/plugin/quickfix_auto_open.vim index 63195da..73b3f4b 100644 --- a/plugin/quickfix_auto_open.vim +++ b/plugin/quickfix_auto_open.vim @@ -5,50 +5,18 @@ " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself " -if exists('loaded_quickfix_auto_open') || &compatible - finish -endif -if !has('autocmd') || v:version < 700 +if exists('loaded_quickfix_auto_open') || &compatible || v:version < 700 finish endif let loaded_quickfix_auto_open = 1 -" Open an appropriate quickfix or location list, depending on the command -function! s:Open(command) abort - - " The command starts with 'l', so we'll be opening a location list - if strpart(a:command, 0, 1) ==# 'l' - - " I can't figure out anything sensible to do for the :lhelpgrep command, - " but for all the other location window commands, :lwindow is sensible - if a:command !=# 'lhelpgrep' - lwindow - endif - - " The command did not start with 'l', so we can just open the quickfix - " window, and we're done - else - cwindow - - endif - -endfunction - " Set up hooks in self-clearing group augroup quickfix_auto_open autocmd! - - " Run whenever a command changes a quickfix or location list - if exists('##QuickFixCmdPost') - autocmd QuickFixCmdPost * - \ call s:Open(expand('<amatch>')) - endif - - " Run on Vim startup completion to open any quickfix list already present, - " with a blank command name - if exists('##VimEnter') - autocmd VimEnter * - \ call s:Open('') - endif - + autocmd VimEnter * + \ cwindow + autocmd QuickFixCmdPost [^l]* + \ cwindow + autocmd QuickFixCmdPost l* + \ lwindow augroup END |