diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-10-23 16:54:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-23 16:54:49 +0200 |
commit | fa4b24072e13dc7303e896701f0bb6d0227caf0c (patch) | |
tree | cc0a7302e1efd5706cb25c2c29af80fe3a7ab46e /src/nvim/marktree.c | |
parent | cb15055c294e6ebb9b2a65041cbff0a79cd3e69e (diff) | |
parent | 8d7816cf27c4ab08d9eff9e7ce3c541105c30ece (diff) | |
download | rneovim-fa4b24072e13dc7303e896701f0bb6d0227caf0c.tar.gz rneovim-fa4b24072e13dc7303e896701f0bb6d0227caf0c.tar.bz2 rneovim-fa4b24072e13dc7303e896701f0bb6d0227caf0c.zip |
Merge pull request #16029 from bfredl/multiline
feat(decorations): support more than one virt_lines block
Diffstat (limited to 'src/nvim/marktree.c')
-rw-r--r-- | src/nvim/marktree.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c index 39c1e36147..a7f540c748 100644 --- a/src/nvim/marktree.c +++ b/src/nvim/marktree.c @@ -221,9 +221,11 @@ static inline void marktree_putp_aux(MarkTree *b, mtnode_t *x, mtkey_t k) } } -uint64_t marktree_put(MarkTree *b, int row, int col, bool right_gravity) +uint64_t marktree_put(MarkTree *b, int row, int col, bool right_gravity, uint8_t decor_level) { uint64_t id = (b->next_id+=ID_INCR); + assert(decor_level < DECOR_LEVELS); + id = id | ((uint64_t)decor_level << DECOR_OFFSET); uint64_t keyid = id; if (right_gravity) { // order all right gravity keys after the left ones, for effortless @@ -235,9 +237,11 @@ uint64_t marktree_put(MarkTree *b, int row, int col, bool right_gravity) } uint64_t marktree_put_pair(MarkTree *b, int start_row, int start_col, bool start_right, int end_row, - int end_col, bool end_right) + int end_col, bool end_right, uint8_t decor_level) { uint64_t id = (b->next_id+=ID_INCR)|PAIRED; + assert(decor_level < DECOR_LEVELS); + id = id | ((uint64_t)decor_level << DECOR_OFFSET); uint64_t start_id = id|(start_right?RIGHT_GRAVITY:0); uint64_t end_id = id|END_FLAG|(end_right?RIGHT_GRAVITY:0); marktree_put_key(b, start_row, start_col, start_id); |