1- --- @since 25.2.26
1+ --- @since 26.5.6
22
33local function setup (_ , opts )
44 local type = opts and opts .type or ui .Border .ROUNDED
@@ -11,40 +11,31 @@ local function setup(_, opts)
1111 end
1212
1313 return ui .Bar (ui .Edge .TOP )
14- :area (
15- ui .Rect { x = x , y = math.max (0 , y ), w = ya .clamp (0 , self ._area .w - x , 1 ), h = math.min (1 , self ._area .h ) }
16- )
14+ :area (ui .Rect {
15+ x = x ,
16+ y = math.max (0 , y ),
17+ w = ya .clamp (0 , self ._area .w - x , 1 ),
18+ h = math.min (1 , self ._area .h ),
19+ })
1720 :symbol (c )
1821 end
1922
2023 local c = self ._chunks
2124 self ._chunks = {
2225 c [1 ]:pad (ui .Pad .y (1 )),
23- -- TODO: remove this compatibility hack
24- fs .unique and c [2 ]:pad (ui .Pad .y (1 )) or c [2 ]:pad (ui .Pad (1 , c [3 ].w > 0 and 0 or 1 , 1 , c [1 ].w > 0 and 0 or 1 )),
26+ c [2 ]:pad (ui .Pad .y (1 )),
2527 c [3 ]:pad (ui .Pad .y (1 )),
2628 }
2729
2830 local style = th .mgr .border_style
29- if rt .opener then -- TODO: remove this compatibility hack
30- self ._base = ya .list_merge (self ._base or {}, {
31- ui .Border (ui .Edge .ALL ):area (self ._area ):type (type ):style (style ),
32-
33- bar (" ┬" , c [2 ].x , c [1 ].y ),
34- bar (" ┴" , c [2 ].x , c [1 ].bottom - 1 ),
35- bar (" ┬" , c [2 ].right - 1 , c [2 ].y ),
36- bar (" ┴" , c [2 ].right - 1 , c [2 ].bottom - 1 ),
37- })
38- else
39- self ._base = ya .list_merge (self ._base or {}, {
40- ui .Border (ui .Edge .ALL ):area (self ._area ):type (type ):style (style ),
41-
42- bar (" ┬" , c [1 ].right - 1 , c [1 ].y ),
43- bar (" ┴" , c [1 ].right - 1 , c [1 ].bottom - 1 ),
44- bar (" ┬" , c [2 ].right , c [2 ].y ),
45- bar (" ┴" , c [2 ].right , c [2 ].bottom - 1 ),
46- })
47- end
31+ self ._base = ya .list_merge (self ._base or {}, {
32+ ui .Border (ui .Edge .ALL ):area (self ._area ):type (type ):style (style ),
33+
34+ bar (" ┬" , c [2 ].x , c [1 ].y ),
35+ bar (" ┴" , c [2 ].x , c [1 ].bottom - 1 ),
36+ bar (" ┬" , c [2 ].right - 1 , c [2 ].y ),
37+ bar (" ┴" , c [2 ].right - 1 , c [2 ].bottom - 1 ),
38+ })
4839
4940 old_build (self , ... )
5041 end
0 commit comments