Skip to content

Commit

Permalink
Don't resize an empty quickfix
Browse files Browse the repository at this point in the history
Prevents vim/vim#11292, and also (more
importantly) prevents the quickfix from becoming 1 line high when you do
a :Ggrep when quickfix is aleady open.
  • Loading branch information
mgedmin committed Oct 5, 2022
1 parent 0ce3b47 commit 8a822e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ftplugin/qf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ if exists("w:quickfix_title")
endif

" Shrink too-high quickfix windows
if winheight(0) > line('$') && get(g:, 'asyncrun_status') != 'running'
" The getqflist() check is a workaround for https://github.com/vim/vim/issues/11292
" it probably breaks autoresizing for loclists, but then I don't use loclists
" so I don't care
if winheight(0) > line('$') && get(g:, 'asyncrun_status') != 'running' && getqflist() != []
exe "resize" line('$')
endif

0 comments on commit 8a822e0

Please sign in to comment.