Fix infinite loop when summary window contains no sections

Resolves: https://github.com/tpope/vim-fugitive/issues/1954
This commit is contained in:
Tim Pope
2022-03-01 07:35:31 -05:00
parent 485ce07c27
commit afd6c13c6b

View File

@@ -4330,7 +4330,7 @@ function! s:Selection(arg1, ...) abort
else else
let last = first let last = first
endif endif
while getline(first) =~# '^$\|^[A-Z][a-z]' while first <= line('$') && getline(first) =~# '^$\|^[A-Z][a-z]'
let first += 1 let first += 1
endwhile endwhile
if first > last || &filetype !=# 'fugitive' if first > last || &filetype !=# 'fugitive'