aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorRobert Muir <rmuir@apache.org>2025-03-04 13:36:57 -0500
committerGitHub <noreply@github.com>2025-03-04 18:36:57 +0000
commit7d5866d471746ca68981e57884eaaeb8dea57f81 (patch)
treef7fb6cbd004699e6f1fdf6cf5d2f70c46d62544e /runtime/lua/vim
parentfb842dfc224d2c40b70648b0ee789304e43ade6c (diff)
downloadrneovim-7d5866d471746ca68981e57884eaaeb8dea57f81.tar.gz
rneovim-7d5866d471746ca68981e57884eaaeb8dea57f81.tar.bz2
rneovim-7d5866d471746ca68981e57884eaaeb8dea57f81.zip
fix(lsp): open_floating_preview() ignores max_height (#32716)
Problem: After 47aaddfa the max_height option is no longer respected. Hover documentation and Signature help windows take up the entire text height. Solution: Compare to window's current height and only modify the height if it would reduce the height, not enlarge it.
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/lsp/util.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 1219f71427..ef177e903f 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -1656,7 +1656,9 @@ function M.open_floating_preview(contents, syntax, opts)
if not opts.height then
-- Reduce window height if TS highlighter conceals code block backticks.
local conceal_height = api.nvim_win_text_height(floating_winnr, {}).all
- api.nvim_win_set_height(floating_winnr, conceal_height)
+ if conceal_height < api.nvim_win_get_height(floating_winnr) then
+ api.nvim_win_set_height(floating_winnr, conceal_height)
+ end
end
end