diff --git a/autoload/sy/repo.vim b/autoload/sy/repo.vim index f08b5dc..0fa709f 100644 --- a/autoload/sy/repo.vim +++ b/autoload/sy/repo.vim @@ -284,7 +284,7 @@ function! s:preview_hunk(_sy, vcs, diff) abort for line in a:diff if in_hunk - if line[:2] == '@@ ' + if line[:2] == '@@ ' || empty(line) break endif call add(hunk, line) diff --git a/autoload/sy/util.vim b/autoload/sy/util.vim index 979b80b..ca036ca 100644 --- a/autoload/sy/util.vim +++ b/autoload/sy/util.vim @@ -124,7 +124,7 @@ function! sy#util#popup_create(hunkdiff) abort let winline = winline() let min_height = 6 let max_height = winheight('%') - winline - let diff_height = len(filter(a:hunkdiff, {_,v -> !empty(v)})) + let diff_height = len(a:hunkdiff) let height = min([diff_height, max_height]) if diff_height > max_height && max_height < min_height