mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 00:38:17 +00:00
refactor(decorations): mark decorations directly on the marktree
This allows to more quickly skip though regions which has non-decorative marks when redrawing. This might seem like a gratuitous micro-optimization in isolation. But! Soon decorations are gonna crop into other hot inner-loop paths, including the plines.c code for calculating the horizontal and vertical space of text. Then we want to quickly skip over regions with "only" overlaying decorations (which do not affect text size)
This commit is contained in:
@@ -96,12 +96,14 @@ uint64_t extmark_set(buf_T *buf, uint64_t ns_id, uint64_t *idp, int row, colnr_T
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t decor_level = (decor != NULL) ? 1 : 0;
|
||||
|
||||
if (end_row > -1) {
|
||||
mark = marktree_put_pair(buf->b_marktree,
|
||||
row, col, right_gravity,
|
||||
end_row, end_col, end_right_gravity);
|
||||
end_row, end_col, end_right_gravity, decor_level);
|
||||
} else {
|
||||
mark = marktree_put(buf->b_marktree, row, col, right_gravity);
|
||||
mark = marktree_put(buf->b_marktree, row, col, right_gravity, decor_level);
|
||||
}
|
||||
|
||||
revised:
|
||||
|
Reference in New Issue
Block a user