Skip to content

Commit 18a5fc1

Browse files
Fix wrong height if popup above cursor
1 parent 1ee290e commit 18a5fc1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

autoload/lsp/ui/vim/output.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,12 @@ function! s:align_preview(options) abort
222222
if s:supports_floating && g:lsp_preview_float && !has('nvim')
223223
" Vim popups
224224
let l:pos = popup_getpos(s:winid)
225-
let l:height = min([l:pos['core_height'], winheight(0) - winline() - 2])
225+
let l:below = l:pos['core_line'] < winline()`
226+
if l:below
227+
let l:height = min([l:pos['core_height'], winheight(0) - winline() - 2])
228+
else
229+
let l:height = min([l:pos['core_height'], winline() - 3])
230+
endif
226231
let l:width = l:pos['core_width']
227232

228233
let l:options = {

0 commit comments

Comments
 (0)