@@ -32,14 +32,17 @@ function Render:setup()
3232 end
3333 local widths = self .node :widths ()
3434 local width = vim .fn .max (widths )
35+
3536 local language = self :offset (self .config .language_pad , width )
3637 local left = self :offset (self .config .left_pad , width )
3738 local right = self :offset (self .config .right_pad , width )
38- local body = math.max (
39- widths [1 ] + language ,
40- left + width + right ,
41- self .config .min_width
42- )
39+
40+ local body = str .width (self .config .language_left )
41+ + str .width (self .config .language_right )
42+ + language
43+ + widths [1 ]
44+ body = math.max (body , left + width + right , self .config .min_width )
45+
4346 self .data = {
4447 language = language ,
4548 padding = left ,
@@ -120,20 +123,24 @@ function Render:language(info, language, delim)
120123 border_hl = colors .bg_as_fg (border_hl )
121124 end
122125
123- local body = self :line ()
126+ local text = self :line ()
124127 if self .config .language_icon and icon then
125- body :text (icon .. ' ' , language_hl )
128+ text :text (icon .. ' ' , language_hl )
126129 end
127130 if self .config .language_name then
128- body :text (language .text , language_hl )
131+ text :text (language .text , language_hl )
129132 end
130133 if self .config .language_info then
131- body :text (info .text :sub (# language .text + 1 ), info_hl )
134+ text :text (info .text :sub (# language .text + 1 ), info_hl )
132135 end
133- if body :empty () then
136+ if text :empty () then
134137 return false
135138 end
136139
140+ local left = self :line ():text (self .config .language_left , border_hl )
141+ local right = self :line ():text (self .config .language_right , border_hl )
142+ local body = left :extend (text ):extend (right )
143+
137144 local border = border_hl and self .config .language_border or ' '
138145 local width = self .data .body - delim .start_col
139146
0 commit comments