neovim

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

commit a376d979bda103fa9998d05c3cc4ba56d3c3cece
parent b2f7a3aaad72fa01dc1230f246c26d878f5a41a6
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed, 14 Feb 2024 07:51:04 +0800

fix(extmarks): redraw line on adding/removing conceal (#27463)


Diffstat:
Msrc/nvim/decoration.c | 3++-
Mtest/functional/ui/decorations_spec.lua | 29+++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c @@ -121,7 +121,8 @@ void decor_redraw(buf_T *buf, int row1, int row2, int col1, DecorInline decor) void decor_redraw_sh(buf_T *buf, int row1, int row2, DecorSignHighlight sh) { - if (sh.hl_id || (sh.url != NULL) || (sh.flags & (kSHIsSign|kSHSpellOn|kSHSpellOff))) { + if (sh.hl_id || (sh.url != NULL) + || (sh.flags & (kSHIsSign | kSHSpellOn | kSHSpellOff | kSHConceal))) { if (row2 >= row1) { redraw_buf_range_later(buf, row1 + 1, row2 + 1); } diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua @@ -1742,6 +1742,35 @@ describe('extmark decorations', function() ]]} end) + it('redraws properly when adding/removing conceal on non-current line', function() + screen:try_resize(50, 5) + api.nvim_buf_set_lines(0, 0, -1, true, {'abcd', 'efgh','ijkl', 'mnop'}) + command('setlocal conceallevel=2') + screen:expect{grid=[[ + ^abcd | + efgh | + ijkl | + mnop | + | + ]]} + api.nvim_buf_set_extmark(0, ns, 2, 1, {end_col=3, conceal=''}) + screen:expect{grid=[[ + ^abcd | + efgh | + il | + mnop | + | + ]]} + api.nvim_buf_clear_namespace(0, ns, 0, -1) + screen:expect{grid=[[ + ^abcd | + efgh | + ijkl | + mnop | + | + ]]} + end) + it('avoids redraw issue #20651', function() exec_lua[[ vim.cmd.normal'10oXXX'