When changing the 'signcolumn' option, Vim triggers UPD_CLEAR (full screen clear + redraw) because it uses the P_RCLR flag. This causes visible flicker, especially in gVim.
Other options that similarly affect the left margin width, such as 'number', 'relativenumber', and 'foldcolumn', all use P_RWIN which triggers UPD_NOT_VALID (redraw without clearing). There is no reason for 'signcolumn' to use a heavier redraw level.
Change P_RCLR to P_RWIN for 'signcolumn' to avoid the unnecessary screen clear.
Related to #19663
https://github.com/vim/vim/pull/19713
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This change alters the drawing area, causing some tests to fail. It appears the difference is due to the command line area no longer being cleared.
Adding "\" to the end of term_sendkeys(), as shown below, resolves the error.
diff --git a/src/testdir/test_cursorline.vim b/src/testdir/test_cursorline.vim index 1aa04c3cb..db0f1a846 100644 --- a/src/testdir/test_cursorline.vim +++ b/src/testdir/test_cursorline.vim @@ -163,17 +163,17 @@ func Test_cursorline_screenline() if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent") " test with set foldcolumn signcolumn and breakindent call term_sendkeys(buf, "gg0") - call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>") + call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>\<C-L>") call VerifyScreenDump(buf, 'Test_'. filename. '_13', {}) - call term_sendkeys(buf, "fagj") + call term_sendkeys(buf, "fagj\<C-L>") call VerifyScreenDump(buf, 'Test_'. filename. '_14', {}) - call term_sendkeys(buf, "gj") + call term_sendkeys(buf, "gj\<C-L>") call VerifyScreenDump(buf, 'Test_'. filename. '_15', {}) - call term_sendkeys(buf, "gj") + call term_sendkeys(buf, "gj\<C-L>") call VerifyScreenDump(buf, 'Test_'. filename. '_16', {}) - call term_sendkeys(buf, "gj") + call term_sendkeys(buf, "gj\<C-L>") call VerifyScreenDump(buf, 'Test_'. filename. '_17', {}) - call term_sendkeys(buf, "gj") + call term_sendkeys(buf, "gj\<C-L>") call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) call term_sendkeys(buf, ":set breakindent& foldcolumn& signcolumn&\<cr>") endif
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@h-east Thank you. However, I noticed that, unlike number, relativenumber, and foldcolumn, signcolumn spans windows. @chrisbra So we should fix redraw issue of P_RCLR ?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
No, signcolumn is a window local option not global option. So P_RWIN is correct option.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@mattn pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
There was an issue with redrawing the sign column when sign icons were used. To address this, patch 8.1.1587 (2b044ff) changed the 'signcolumn' option setting from P_RWIN to P_RCLR. Reverting this change will reintroduce the redraw problem with sign icons.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@mattn pushed 4 commits.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
please take a look
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
did you check if this re-introduces this regression here: #4578
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@mattn pushed 5 commits.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Added a test Test_sign_signcolumn_change_no_clear in test_signs.vim.
This test verifies that changing 'signcolumn' correctly redraws the sign column. At the same time, it checks whether the command line (displayed via echon) is cleared. With this fix, the echon output is not cleared, confirming that no unnecessary full-screen clear (flicker) occurs.
P_RCLR): set signcolumn=number triggers redraw_all_later(UPD_CLEAR), which clears the entire screen including the command line → test FAILSP_RWIN): only the window is redrawn, the command line is preserved → test PASSES—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Hm, does that test only work in non-gui mode?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Ah, right. This optimization only takes effect in non-GUI (terminal) mode. In the GUI, did_set_signcolumn() still calls redraw_all_later(UPD_CLEAR) when sign icons are present, so the behavior is unchanged there. I've added CheckNotGui to the test.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@mattn pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
To clarify why this optimization is limited to non-GUI mode: in the GUI, signs can be displayed as icons (pixel-based), and UPD_NOT_VALID does not clear the old icon pixels, leaving artifacts on screen. In terminal mode, signs are text characters that are simply overwritten by the normal redraw, so UPD_CLEAR is unnecessary.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Ah, wait. issuer reported
Although the issue can only be reproduced in gVim, terminal Vim should have the same problem.
So, this optimization does not fix completely.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Correction on my previous comments: the optimization is not limited to non-GUI mode. It also applies to the GUI when no signs are present. UPD_CLEAR is only triggered when gui.in_use and the buffer has signs, because sign icons are pixel-based and need a full screen clear to avoid rendering artifacts.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Here is a summary of the behavior for each case:
P_RWIN → UPD_NOT_VALID (no flicker)P_RWIN → UPD_NOT_VALID (no flicker)did_set_signcolumn() calls redraw_all_later(UPD_CLEAR) (same as before)P_RWIN → UPD_NOT_VALID (no flicker)Previously, all four cases used P_RCLR and triggered UPD_CLEAR. With this change, only case 3 still triggers UPD_CLEAR to avoid sign icon rendering artifacts.
For testing: cases 2 and 4 have no signs, so there is nothing to verify. Case 1 is covered by Test_sign_signcolumn_change_no_clear. Case 3 is unchanged behavior (UPD_CLEAR), and Test_sign_cursor_position (screendump test) confirms that signs are displayed correctly.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
alright, thanks for clarification
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()