mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-09 18:14:27 +03:00
Render Private Use Unicode symbols using two cells if the second cell contains a non-breaking space as well as a normal space
There is some software out there that uses nbsp as a separator, presumably as some kind of hack. https://github.com/ibhagwan/fzf-lua/issues/916
This commit is contained in:
parent
539a8706dc
commit
ce583ea460
@ -76,6 +76,8 @@ Detailed list of changes
|
||||
|
||||
- When pasting, if the text contains terminal control codes ask the user for permission. See :opt:`paste_actions` for details. Thanks to David Leadbeater for discovering this.
|
||||
|
||||
- Render Private Use Unicode symbols using two cells if the second cell contains a non-breaking space as well as a normal space
|
||||
|
||||
|
||||
0.30.1 [2023-10-05]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -19,9 +19,9 @@ 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 empty cell 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`.
|
||||
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
|
||||
can be turned off for specific symbols using :opt:`narrow_symbols`.
|
||||
|
||||
|
||||
Using a color theme with a background color does not work well in vim?
|
||||
|
@ -534,6 +534,7 @@ START_ALLOW_CASE_RANGE
|
||||
switch(cpu_cell->ch) {
|
||||
case 0:
|
||||
case ' ':
|
||||
case 0xa0: // nbsp
|
||||
case '\t':
|
||||
case IMAGE_PLACEHOLDER_CHAR:
|
||||
return BLANK_FONT;
|
||||
@ -1325,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 == ' ' || line->cpu_cells[i+num_spaces+1].ch == 0xa0) // space or nbsp
|
||||
&& num_spaces < MAX_NUM_EXTRA_GLYPHS_PUA
|
||||
&& num_spaces + 1 < desired_cells
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user