чување 7d20500be6946992ae4915744e7ec9bbc4e6a83e
родитељ f3cb7439dd1bf1c01ce347c01d076cfb2905ab04
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Wed, 17 May 2023 16:42:37 +0200
Bugfix: increase current_rune_column by output_runes, not rune_length
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 1, додавања: 18(+), брисања: 2(-)
diff --git a/table.c b/table.c
@@ -505,9 +505,25 @@ print_aligned(const u8* s, size_t rune_length, size_t to_size, Alignment align,
ps += ch_len;
skipped_runes++;
}
- printf("%s", (char*)ps);
+ output_runes = 0;
+ while (output_runes != MIN(rune_length, colwidth))
+ {
+ skip_while_sgr(ps, &skipped_chars, 1, 0);
+ ps += skipped_chars;
+
+ u8_char_to_u32(&uch, ps, &ch_len);
+ output_chars = 0;
+ while (output_chars != ch_len)
+ {
+ printf("%c", (char)*ps++);
+ output_chars++;
+ }
+ output_runes++;
+ }
+ skip_while_sgr(ps, &skipped_chars, 1, 1);
+ ps += skipped_chars;
}
- (*current_rune_column) += rune_length;
+ (*current_rune_column) += output_runes;
return 0;
}