Ale: Auto-close the error list

Created on 22 Jan 2018  路  3Comments  路  Source: dense-analysis/ale

Is there anything similar to https://github.com/vim-syntastic/syntastic/pull/126?

That is, a way to automatically close the error window when closing buffers.

What I currently experience is that I can open a file that contains lint errors, the error window appears, then I close that file but am left with the error window of the now closed file.

enhancement

Most helpful comment

It looks like this can be accomplished, assuming you are using the loclist rather than quickfix, with an autocommand like this:

autocmd QuitPre * if empty(&bt) | lclose | endif

I'll put together a pull request that piggybacks on the QuitPre autocmd that ale already has.

All 3 comments

Feel free to create a PR for this if you can figure it out.

It looks like this can be accomplished, assuming you are using the loclist rather than quickfix, with an autocommand like this:

autocmd QuitPre * if empty(&bt) | lclose | endif

I'll put together a pull request that piggybacks on the QuitPre autocmd that ale already has.

I updated the documentation to tell people how to write an autocmd command to do this, so you can copy and paste that into vimrc or wherever to do this.

Was this page helpful?
0 / 5 - 0 ratings