mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +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:
@@ -75,4 +75,11 @@ typedef struct {
|
||||
#define MARKTREE_PAIRED_FLAG (((uint64_t)1) << 1)
|
||||
#define MARKTREE_END_FLAG (((uint64_t)1) << 0)
|
||||
|
||||
#define DECOR_LEVELS 4
|
||||
#define DECOR_OFFSET 61
|
||||
#define DECOR_MASK (((uint64_t)(DECOR_LEVELS-1)) << DECOR_OFFSET)
|
||||
static inline uint8_t mt_decor_level(uint64_t id) {
|
||||
return (uint8_t)((id&DECOR_MASK) >> DECOR_OFFSET);
|
||||
}
|
||||
|
||||
#endif // NVIM_MARKTREE_H
|
||||
|
Reference in New Issue
Block a user