From 6ce9bf9abdf1f46688d8cf6ed679008247cfec1e Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Sat, 20 Sep 2014 19:26:28 +0300 Subject: [PATCH] Clear loclist when running lolder at the bottom of the loclist stack. This saves people some confusion when syntastic_always_populate_loc_list is unset and they try to open the error window with :lopen or :lwindow. --- plugin/syntastic.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index b65017c8..2aad171a 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:syntastic_start endif -let g:syntastic_version = '3.5.0-26' +let g:syntastic_version = '3.5.0-27' lockvar g:syntastic_version " Sanity checks {{{1 @@ -483,7 +483,15 @@ function! SyntasticMake(options) " {{{2 execute 'lcd ' . fnameescape(old_cwd) endif - silent! lolder + try + silent lolder + catch /\m^Vim\%((\a\+)\)\=:E380/ + " E380: At bottom of quickfix stack + call setloclist(0, [], 'r') + catch /\m^Vim\%((\a\+)\)\=:E776/ + " E776: No location list + " do nothing + endtry " restore options {{{3 let &errorformat = old_errorformat