diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-02-26 02:07:35 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-03-01 20:02:10 -0500 |
commit | 4ccbc8d56eb7aea41c87a835be52396b945a0143 (patch) | |
tree | 2bcb0370bac6e33c7d2f4fc59631378b691b39a1 | |
parent | c40bb2de7ac5cfb3e2b6d45591f0fea8642be1cd (diff) | |
download | rneovim-4ccbc8d56eb7aea41c87a835be52396b945a0143.tar.gz rneovim-4ccbc8d56eb7aea41c87a835be52396b945a0143.tar.bz2 rneovim-4ccbc8d56eb7aea41c87a835be52396b945a0143.zip |
vim-patch:8.2.0108: when sign text is changed a manual redraw is needed
Problem: When sign text is changed a manual redraw is needed. (Pontus
Lietzler)
Solution: Redraw automatically. (closes vim/vim#5455)
https://github.com/vim/vim/commit/bf0acff012c2f75563c20241f1a5478534fe2c7a
-rw-r--r-- | src/nvim/sign.c | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_signs.vim | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/nvim/sign.c b/src/nvim/sign.c index e22a177178..ab5d04d39b 100644 --- a/src/nvim/sign.c +++ b/src/nvim/sign.c @@ -831,6 +831,14 @@ int sign_define_by_name( } else { sp_prev->sn_next = sp; } + } else { + // Signs may already exist, a redraw is needed in windows with a + // non-empty sign list. + FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { + if (wp->w_buffer->b_signlist != NULL) { + redraw_buf_later(wp->w_buffer, NOT_VALID); + } + } } // set values for a defined sign. diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim index b80e41bd0c..8b1927e4f0 100644 --- a/src/nvim/testdir/test_signs.vim +++ b/src/nvim/testdir/test_signs.vim @@ -1726,12 +1726,16 @@ func Test_sign_cursor_position() END call writefile(lines, 'XtestSigncolumn') let buf = RunVimInTerminal('-S XtestSigncolumn', {'rows': 6}) - call VerifyScreenDump(buf, 'Test_sign_cursor_01', {}) + call VerifyScreenDump(buf, 'Test_sign_cursor_1', {}) + + " Change the sign text + call term_sendkeys(buf, ":sign define s1 text=-)\<CR>") + call VerifyScreenDump(buf, 'Test_sign_cursor_2', {}) " update cursor position calculation call term_sendkeys(buf, "lh") call term_sendkeys(buf, ":sign unplace 10\<CR>") - call VerifyScreenDump(buf, 'Test_sign_cursor_02', {}) + call VerifyScreenDump(buf, 'Test_sign_cursor_3', {}) " clean up |