From 08438846b8016a9457c3234f4066655dc62b97a0 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Sun, 6 Oct 2024 17:34:12 -0400 Subject: [PATCH] fix: respect min/max width for autocomplete window rendering --- lua/blink/cmp/windows/autocomplete.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/blink/cmp/windows/autocomplete.lua b/lua/blink/cmp/windows/autocomplete.lua index 61a0ed03..8f4a00f5 100644 --- a/lua/blink/cmp/windows/autocomplete.lua +++ b/lua/blink/cmp/windows/autocomplete.lua @@ -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