Skip to content

Commit

Permalink
fix: respect min/max width for autocomplete window rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Oct 6, 2024
1 parent 2c6ee0d commit 0843884
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/blink/cmp/windows/autocomplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ function autocomplete.draw()
)
end

local max_line_length = renderer.get_max_length(arr_of_components)
local max_line_length =
math.min(autocmp_config.max_width, math.max(autocmp_config.min_width, renderer.get_max_length(arr_of_components)))
autocomplete.rendered_items = vim.tbl_map(
function(component) return renderer.render(component, max_line_length) end,
arr_of_components
Expand Down

0 comments on commit 0843884

Please sign in to comment.