Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle closing the loclist window in a QuitPre.
Remove the prematurely added option g:syntastic_allow_quit.
  • Loading branch information
lcd047 committed Apr 27, 2013
1 parent 85417fd commit c9b9a9e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
12 changes: 0 additions & 12 deletions doc/syntastic.txt
Expand Up @@ -221,18 +221,6 @@ when saving or opening a file: >
let g:syntastic_auto_jump=1
<

*'syntastic_allow_quit'*
Default: 1
When the |location-list| is open and you quit a buffer, syntastic attempts to
detect if this is the last active buffer, and quit Vim if it is. This is
usually what you want, but in that situation Vim will also abandon any hidden
buffers, thus potentially destroying a carefully crafted session. Use this
variable to prevent syntastic from quitting Vim.

When |syntastic_allow_quit| is 0 syntastic will never issue a 'quit' command: >
let g:syntastic_allow_quit=0
<

*'syntastic_auto_loc_list'*
Default: 2
Use this option to tell syntastic to automatically open and/or close the
Expand Down
5 changes: 1 addition & 4 deletions plugin/syntastic.vim
Expand Up @@ -40,10 +40,6 @@ if !exists("g:syntastic_check_on_open")
let g:syntastic_check_on_open = 0
endif

if !exists("g:syntastic_allow_quit")
let g:syntastic_allow_quit = 1
endif

if !exists("g:syntastic_loc_list_height")
let g:syntastic_loc_list_height = 10
endif
Expand Down Expand Up @@ -79,6 +75,7 @@ augroup syntastic
" TODO: the next autocmd should be "autocmd BufWinLeave * if empty(&bt) | lclose | endif"
" but in recent versions of Vim lclose can no longer be called from BufWinLeave
autocmd BufEnter * call s:BufWinLeaveCleanup()
autocmd QuitPre * call g:SyntasticLoclistHide()
augroup END


Expand Down
8 changes: 1 addition & 7 deletions plugin/syntastic/loclist.vim
Expand Up @@ -146,13 +146,7 @@ endfunction
" Non-method functions {{{1

function! g:SyntasticLoclistHide()
if len(filter( range(1, bufnr('$')), 'syntastic#util#bufIsActive(v:val)' )) == 1
if g:syntastic_allow_quit
quit
endif
else
lclose
endif
silent! lclose
endfunction

" vim: set sw=4 sts=4 et fdm=marker:

0 comments on commit c9b9a9e

Please sign in to comment.