Skip to content

Commit

Permalink
fix: handle blob-type in documentation height computation
Browse files Browse the repository at this point in the history
Resolves scrollbar rendering issues when LSP servers (e.g., Pyright)
sometimes return blob-type content in documentation. Converts blobs to
strings before computing line widths to ensure accurate documentation
window sizing.

Fix Saghen#1320
  • Loading branch information
soifou committed Mar 4, 2025
1 parent 662a67c commit 19c50f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/blink/cmp/lib/window/scrollbar/geometry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ local function get_win_buf_height(target_win)
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
local height = 0
for _, l in ipairs(lines) do
if vim.fn.type(l) == vim.v.t_blob then l = vim.fn.string(l) end
height = height + math.max(1, (math.ceil(vim.fn.strwidth(l) / width)))
end
return height
Expand Down

0 comments on commit 19c50f6

Please sign in to comment.