mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
Fix completion documentation floating window to show even when there is not enough space (#1334)
This commit is contained in:
@@ -109,6 +109,15 @@ function! s:show_floating_window(event, managed_user_data) abort
|
|||||||
\ 'maxwidth': float2nr(&columns * 0.4),
|
\ 'maxwidth': float2nr(&columns * 0.4),
|
||||||
\ 'maxheight': float2nr(&lines * 0.4),
|
\ 'maxheight': float2nr(&lines * 0.4),
|
||||||
\ })
|
\ })
|
||||||
|
let l:margin_right = &columns - 1 - (a:event.col + a:event.width + 1 + (a:event.scrollbar ? 1 : 0))
|
||||||
|
let l:margin_left = a:event.col - 3
|
||||||
|
if l:size.width < l:margin_right
|
||||||
|
" do nothing
|
||||||
|
elseif l:margin_left <= l:margin_right
|
||||||
|
let l:size.width = l:margin_right
|
||||||
|
else
|
||||||
|
let l:size.width = l:margin_left
|
||||||
|
endif
|
||||||
let l:pos = s:compute_position(a:event, l:size)
|
let l:pos = s:compute_position(a:event, l:size)
|
||||||
if empty(l:pos)
|
if empty(l:pos)
|
||||||
call s:close_floating_window(v:true)
|
call s:close_floating_window(v:true)
|
||||||
|
|||||||
Reference in New Issue
Block a user