This commit is contained in:
Kovid Goyal 2023-10-25 12:14:36 +05:30
parent 9c25a183db
commit 8c83284d5e
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 4 deletions

View file

@ -19,8 +19,8 @@ use Unicode characters from the private use area to represent symbols. Often
these symbols are wide and should be rendered in two cells. However, since
private use area symbols all have their width set to one in the Unicode
standard, |kitty| renders them either smaller or truncated. The exception is if
these characters are followed by a space or non-breaking space in which case
kitty makes use of the extra cell to render them in two cells. This behavior
these characters are followed by a space or en-space (U+2002) in which case
kitty makes use of the extra cell to render them in two cells. This behavior
can be turned off for specific symbols using :opt:`narrow_symbols`.

View file

@ -534,7 +534,7 @@ START_ALLOW_CASE_RANGE
switch(cpu_cell->ch) {
case 0:
case ' ':
case 0xa0: // nbsp
case 0x2002: // en-space
case '\t':
case IMAGE_PLACEHOLDER_CHAR:
return BLANK_FONT;
@ -1326,7 +1326,7 @@ render_line(FONTS_DATA_HANDLE fg_, Line *line, index_type lnum, Cursor *cursor,
unsigned int num_spaces = 0;
while (
i + num_spaces + 1 < line->xnum
&& (line->cpu_cells[i+num_spaces+1].ch == ' ' || line->cpu_cells[i+num_spaces+1].ch == 0xa0) // space or nbsp
&& (line->cpu_cells[i+num_spaces+1].ch == ' ' || line->cpu_cells[i+num_spaces+1].ch == 0x2002) // space or en-space
&& num_spaces < MAX_NUM_EXTRA_GLYPHS_PUA
&& num_spaces + 1 < desired_cells
) {