Safer closing of the error window.

This commit is contained in:
LCD 47 2014-12-08 11:14:17 +02:00
parent c74f28ace2
commit 0c1dd2aa01
2 changed files with 7 additions and 4 deletions

View File

@ -163,8 +163,9 @@ Example: >
You can use the |:Errors| command to display the errors for the current buffer
in the |location-list|.
Note that when you use |:Errors|, the current location list is overwritten
with Syntastic's own location list.
Note that when you use |:Errors| the current location list is overwritten with
Syntastic's own location list. The location list is also overwritten when
|syntastic_auto_jump| is non-zero and the cursor has to jump to an issue.
By default syntastic doesn't fill the |location-list| with the errors found by
the checkers, in order to reduce clashes with other plugins. Consequently, if

View File

@ -260,7 +260,7 @@ function! s:BufEnterHook() " {{{2
let loclist = filter(copy(getloclist(0)), 'v:val["valid"] == 1')
let owner = str2nr(getbufvar(bufnr(""), 'syntastic_owner_buffer'))
let buffers = syntastic#util#unique(map(loclist, 'v:val["bufnr"]') + (owner ? [owner] : []))
if !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
if get(w:, 'syntastic_loclist_set', 0) && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
call SyntasticLoclistHide()
endif
endif
@ -270,7 +270,9 @@ function! s:QuitPreHook() " {{{2
call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
let b:syntastic_skip_checks = get(b:, 'syntastic_skip_checks', 0) || !syntastic#util#var('check_on_wq')
if get(w:, 'syntastic_loclist_set', 0)
call SyntasticLoclistHide()
endif
endfunction " }}}2
" }}}1