neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit a195dc7c83b3da16e293ddb468ef18254957b4a4
parent 837ea6da9f65ac4ec85421c6e4af15194cc222d0
Author: ii14 <59243201+ii14@users.noreply.github.com>
Date:   Sun, 19 Jun 2022 19:33:54 +0200

fix(decorations): nvim_buf_set_extmark breaks conceal #19010

Closes #19007

Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat:
Msrc/nvim/decoration.c | 2+-
Msrc/nvim/extmark.c | 1+
Mtest/functional/ui/decorations_spec.lua | 15+++++++++++++++
3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c @@ -69,7 +69,7 @@ void bufhl_add_hl_pos_offset(buf_T *buf, int src_id, int hl_id, lpos_T pos_start void decor_redraw(buf_T *buf, int row1, int row2, Decoration *decor) { if (row2 >= row1) { - if (!decor || decor->hl_id || decor_has_sign(decor)) { + if (!decor || decor->hl_id || decor_has_sign(decor) || decor->conceal) { redraw_buf_range_later(buf, row1 + 1, row2 + 1); } } diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c @@ -68,6 +68,7 @@ void extmark_set(buf_T *buf, uint32_t ns_id, uint32_t *idp, int row, colnr_T col if (decor) { if (kv_size(decor->virt_text) || kv_size(decor->virt_lines) + || decor->conceal || decor_has_sign(decor) || decor->ui_watched) { decor_full = true; diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua @@ -483,6 +483,7 @@ describe('extmark decorations', function() [23] = {foreground = Screen.colors.Magenta1, background = Screen.colors.LightGrey}; [24] = {bold = true}; [25] = {background = Screen.colors.LightRed}; + [26] = {background=Screen.colors.DarkGrey, foreground=Screen.colors.LightGrey}; } ns = meths.create_namespace 'test' @@ -864,6 +865,20 @@ end]] ]]} helpers.assert_alive() end) + + it('conceal #19007', function() + screen:try_resize(50, 5) + insert('foo\n') + command('let &conceallevel=2') + meths.buf_set_extmark(0, ns, 0, 0, {end_col=0, end_row=2, conceal='X'}) + screen:expect([[ + {26:X} | + ^ | + {1:~ }| + {1:~ }| + | + ]]) + end) end) describe('decorations: virtual lines', function()