Skip to content

Commit 0843884

Browse files
committed
fix: respect min/max width for autocomplete window rendering
1 parent 2c6ee0d commit 0843884

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/blink/cmp/windows/autocomplete.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ function autocomplete.draw()
176176
)
177177
end
178178

179-
local max_line_length = renderer.get_max_length(arr_of_components)
179+
local max_line_length =
180+
math.min(autocmp_config.max_width, math.max(autocmp_config.min_width, renderer.get_max_length(arr_of_components)))
180181
autocomplete.rendered_items = vim.tbl_map(
181182
function(component) return renderer.render(component, max_line_length) end,
182183
arr_of_components

0 commit comments

Comments
 (0)