mirror of
https://github.com/neovim/neovim.git
synced 2026-08-02 21:59:11 +00:00
perf(ui): defer title attr resolution
In case of an overflow, the iteration will break before the grid_line_puts call.
This commit is contained in:
@@ -1103,12 +1103,6 @@ static void grid_draw_bordertext(VirtText vt, int col, int winbl, const int *hl_
|
||||
if (text == NULL) {
|
||||
break;
|
||||
}
|
||||
if (attr == -1) { // No highlight specified.
|
||||
attr = default_attr;
|
||||
} else {
|
||||
attr = hl_apply_winblend(winbl, attr);
|
||||
attr = hl_combine_attr(win_hl_attr_normal, attr);
|
||||
}
|
||||
// Skip characters from the beginning when title overflows available width.
|
||||
if (overflow > 0) {
|
||||
int cells = (int)mb_string2cells(text);
|
||||
@@ -1125,6 +1119,12 @@ static void grid_draw_bordertext(VirtText vt, int col, int winbl, const int *hl_
|
||||
}
|
||||
text = p;
|
||||
}
|
||||
if (attr == -1) { // No highlight specified.
|
||||
attr = default_attr;
|
||||
} else {
|
||||
attr = hl_apply_winblend(winbl, attr);
|
||||
attr = hl_combine_attr(win_hl_attr_normal, attr);
|
||||
}
|
||||
col += grid_line_puts(col, text, -1, attr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user