@@ -426,31 +426,32 @@ local prepare_node = function(item, state)
426426 local should_pad = false
427427
428428 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+ repeat
430+ if component .enabled == false then
431+ break
432+ end
433+ local component_data , component_wanted_width =
434+ M .render_component (component , item , state , remaining_cols - (should_pad and 1 or 0 ))
435+ local actual_width = 0
436+ if component_data then
437+ for _ , data in ipairs (component_data ) do
438+ if data .text then
439+ local padding = " "
440+ if should_pad and # data .text and data .text :sub (1 , 1 ) ~= " " and not data .no_padding then
441+ padding = " "
442+ end
443+ data .text = padding .. data .text
444+ should_pad = data .text :sub (# data .text ) ~= " " and not data .no_next_padding
444445
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 )
446+ actual_width = actual_width + vim .api .nvim_strwidth (data .text )
447+ line :append (data .text , data .highlight )
448+ remaining_cols = remaining_cols - vim .fn .strchars (data .text )
449+ end
448450 end
449451 end
450- end
451- component_wanted_width = component_wanted_width or actual_width
452- wanted_width = wanted_width + component_wanted_width
453- :: continue::
452+ component_wanted_width = component_wanted_width or actual_width
453+ wanted_width = wanted_width + component_wanted_width
454+ until true
454455 end
455456
456457 line .wanted_width = wanted_width
0 commit comments