File tree 1 file changed +7
-2
lines changed
lua/blink/cmp/windows/lib
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -108,17 +108,22 @@ end
108
108
--- @return number[]
109
109
function renderer .get_max_lengths (components_list , min_width )
110
110
local lengths = {}
111
+ local first_fill = 1
112
+
111
113
for _ , components in ipairs (components_list ) do
112
114
for i , component in ipairs (components ) do
113
115
local length = renderer .get_length (component )
114
116
if not lengths [i ] or lengths [i ] < length then lengths [i ] = length end
117
+ if component .fill and first_fill == 1 then first_fill = i end
115
118
end
116
119
end
117
120
118
- for i , length in ipairs (lengths ) do
119
- if length < min_width then lengths [ i ] = min_width end
121
+ for _ , length in ipairs (lengths ) do
122
+ min_width = min_width - length
120
123
end
121
124
125
+ if min_width > 0 then lengths [first_fill ] = lengths [first_fill ] + min_width end
126
+
122
127
return lengths
123
128
end
124
129
You can’t perform that action at this time.
0 commit comments