Fix ambiguous width and private use characters not being rendered when used with variable width text-sizing protocol escape codes

This commit is contained in:
Kovid Goyal 2025-05-12 05:21:51 +05:30
parent 7791a9129c
commit 68b4c3dd6d
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 12 additions and 2 deletions

View file

@ -106,6 +106,11 @@ consumption to do the same tasks.
Detailed list of changes
-------------------------------------
0.42.1 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Fix ambiguous width and private use characters not being rendered when used with variable width text-sizing protocol escape codes
0.42.0 [2025-05-11]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -1323,8 +1323,10 @@ screen_handle_multicell_command(Screen *self, const MultiCellCommand *cmd, const
if ((s = grapheme_segmentation_step(s, cp)).add_to_current_cell || (wcwidth_std(cp) == 0 && lc.count)) lc.chars[lc.count++] = ch;
else {
if (lc.count) handle_variable_width_multicell_command(self, mcd, &lc);
if (wcwidth_std(cp) < 1) lc.count = 0;
else { lc.chars[0] = ch; lc.count = 1; }
switch(wcwidth_std(cp)) {
case 0: case -1: lc.count = 0; break;
default: lc.chars[0] = ch; lc.count = 1; break;
}
}
}
if (lc.count) handle_variable_width_multicell_command(self, mcd, &lc);

View file

@ -135,6 +135,9 @@ def test_multicell(self: TestMulticell) -> None:
for x in range(1, 3):
comb(x, y)
comb(0, 1)
s.reset()
multicell(s, 'aüa', scale=2)
self.ae(s.cursor.x, 6)
s = self.create_screen(cols=7 * 7, lines=7)
multicell(s, 'a', scale=7, width=7)
for y in range(s.lines):