- commit
- 5bd44f47b44cad395ee445ebc88ea7f4daf4bf24
- parent
- 1b112d739d4736525c3f02962c5957d89ec06462
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-05-08 10:45
use location list instead of quickfix list local to window
Diffstat
| M | autoload/lint.vim | 10 | +++++----- |
| M | plugin/lint.vim | 2 | +- |
2 files changed, 6 insertions, 6 deletions
diff --git a/autoload/lint.vim b/autoload/lint.vim
@@ -11,7 +11,7 @@ function! s:RunLinter(prg, format) 11 11 let &t_ti = '' 12 12 let &t_te = '' 13 1314 -1 silent! make! '%'-1 14 silent! lmake! '%' 15 15 16 16 let &makeprg = l:old_makeprg 17 17 let &errorformat = l:old_errorformat @@ -19,11 +19,11 @@ function! s:RunLinter(prg, format) 19 19 let &t_ti = l:old_t_ti 20 20 let &t_te = l:old_t_te 21 2122 -1 return getqflist()-1 22 return getloclist(winnr()) 23 23 endfunction 24 24 25 25 function! lint#Lint()26 -1 cclose-1 26 lclose 27 27 if !exists('b:lint_prg') || !exists('b:lint_format') 28 28 echon 'No linter configured' 29 29 return @@ -34,10 +34,10 @@ function! lint#Lint() 34 34 let l:results = s:RunLinter(b:lint_prg, b:lint_format) 35 35 call filter(l:results, 'v:val.lnum') 36 36 if l:results != []37 -1 copen-1 37 lopen 38 38 echon 'Lint found '.len(l:results).' issues' 39 39 else40 -1 cclose-1 40 lclose 41 41 echon 'Lint OK' 42 42 endif 43 43 endfunction
diff --git a/plugin/lint.vim b/plugin/lint.vim
@@ -1,6 +1,6 @@ 1 1 command! Lint call lint#Lint() 2 2 nnoremap <F7> :Lint<CR>3 -1 autocmd QuitPre * cclose-1 3 autocmd QuitPre * lclose 4 4 5 5 nnoremap [q :cprev<CR> 6 6 nnoremap ]q :cnext<CR>