@@ -426,31 +426,29 @@ local prepare_node = function(item, state)
426
426
local should_pad = false
427
427
428
428
for _ , component in ipairs (renderer ) do
429
- if component .enabled == false then
430
- goto continue
431
- end
432
- local component_data , component_wanted_width =
433
- M .render_component (component , item , state , remaining_cols - (should_pad and 1 or 0 ))
434
- local actual_width = 0
435
- if component_data then
436
- for _ , data in ipairs (component_data ) do
437
- if data .text then
438
- local padding = " "
439
- if should_pad and # data .text and data .text :sub (1 , 1 ) ~= " " and not data .no_padding then
440
- padding = " "
441
- end
442
- data .text = padding .. data .text
443
- should_pad = data .text :sub (# data .text ) ~= " " and not data .no_next_padding
429
+ if component .enabled then
430
+ local component_data , component_wanted_width =
431
+ M .render_component (component , item , state , remaining_cols - (should_pad and 1 or 0 ))
432
+ local actual_width = 0
433
+ if component_data then
434
+ for _ , data in ipairs (component_data ) do
435
+ if data .text then
436
+ local padding = " "
437
+ if should_pad and # data .text and data .text :sub (1 , 1 ) ~= " " and not data .no_padding then
438
+ padding = " "
439
+ end
440
+ data .text = padding .. data .text
441
+ should_pad = data .text :sub (# data .text ) ~= " " and not data .no_next_padding
444
442
445
- actual_width = actual_width + vim .api .nvim_strwidth (data .text )
446
- line :append (data .text , data .highlight )
447
- remaining_cols = remaining_cols - vim .fn .strchars (data .text )
443
+ actual_width = actual_width + vim .api .nvim_strwidth (data .text )
444
+ line :append (data .text , data .highlight )
445
+ remaining_cols = remaining_cols - vim .fn .strchars (data .text )
446
+ end
448
447
end
449
448
end
449
+ component_wanted_width = component_wanted_width or actual_width
450
+ wanted_width = wanted_width + component_wanted_width
450
451
end
451
- component_wanted_width = component_wanted_width or actual_width
452
- wanted_width = wanted_width + component_wanted_width
453
- :: continue::
454
452
end
455
453
456
454
line .wanted_width = wanted_width
0 commit comments