[vim/vim] Use P_RWIN instead of P_RCLR for 'signcolumn' to avoid flicker (PR #19713)

15 views
Skip to first unread message

mattn

unread,
Mar 16, 2026, 5:35:38 AM (9 days ago) Mar 16
to vim/vim, Subscribed

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


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19713

Commit Summary

  • 4f9a366 fix: use P_RWIN instead of P_RCLR for 'signcolumn' option

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713@github.com>

h_east

unread,
Mar 16, 2026, 7:10:14 AM (9 days ago) Mar 16
to vim/vim, Subscribed
h-east left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4066887736@github.com>

mattn

unread,
Mar 16, 2026, 7:34:20 AM (9 days ago) Mar 16
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

@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.Message ID: <vim/vim/pull/19713/c4067013360@github.com>

mattn

unread,
Mar 16, 2026, 7:44:32 AM (9 days ago) Mar 16
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4067065039@github.com>

mattn

unread,
Mar 16, 2026, 7:50:43 AM (9 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • a4690e1 update screendump expectations for Test_cursorline_screenline


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/before/4f9a3661c067f3a20324c68f3bb598d41b587def/after/a4690e1b9fa658bde959f997cf46645fd331d5f4@github.com>

mattn

unread,
Mar 16, 2026, 9:08:35 AM (9 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • 996c1eb update screendump expectations for test_textprop

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/before/a4690e1b9fa658bde959f997cf46645fd331d5f4/after/996c1eb41ec13785f8a72eb20e386157b9119b7d@github.com>

Yegappan Lakshmanan

unread,
Mar 16, 2026, 11:24:39 AM (8 days ago) Mar 16
to vim/vim, Subscribed
yegappan left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4068474982@github.com>

mattn

unread,
Mar 16, 2026, 1:17:27 PM (8 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • a174145 add UPD_CLEAR for GUI sign icons when changing 'signcolumn'

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/before/996c1eb41ec13785f8a72eb20e386157b9119b7d/after/a1741451b5b3eddd40e2ac0ef46fcc9f0c10a5aa@github.com>

mattn

unread,
Mar 20, 2026, 8:37:36 PM (4 days ago) Mar 20
to vim/vim, Push

@mattn pushed 4 commits.

  • a082354 fix: use P_RWIN instead of P_RCLR for 'signcolumn' option
  • 098ee95 update screendump expectations for Test_cursorline_screenline
  • 0404e80 update screendump expectations for test_textprop
  • d46be2a add UPD_CLEAR for GUI sign icons when changing 'signcolumn'


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/before/a1741451b5b3eddd40e2ac0ef46fcc9f0c10a5aa/after/d46be2a13be86eb1e7f9601ff1c5c84a114a40d4@github.com>

mattn

unread,
Mar 22, 2026, 12:46:06 PM (2 days ago) Mar 22
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

please take a look


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/c4106573428@github.com>

Christian Brabandt

unread,
Mar 22, 2026, 4:57:00 PM (2 days ago) Mar 22
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4106971476@github.com>

mattn

unread,
Mar 22, 2026, 10:00:13 PM (2 days ago) Mar 22
to vim/vim, Push

@mattn pushed 5 commits.

  • f503abc fix: use P_RWIN instead of P_RCLR for 'signcolumn' option
  • 09c00b9 update screendump expectations for Test_cursorline_screenline
  • 2055ec3 update screendump expectations for test_textprop
  • a630f71 add UPD_CLEAR for GUI sign icons when changing 'signcolumn'
  • a060b31 add test for signcolumn change not triggering unnecessary UPD_CLEAR


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/before/d46be2a13be86eb1e7f9601ff1c5c84a114a40d4/after/a060b31adb10749b393c7e6713b2d395ee93778e@github.com>

mattn

unread,
Mar 22, 2026, 10:01:10 PM (2 days ago) Mar 22
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

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.

  • Without the fix (P_RCLR): set signcolumn=number triggers redraw_all_later(UPD_CLEAR), which clears the entire screen including the command line → test FAILS
  • With the fix (P_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.Message ID: <vim/vim/pull/19713/c4107521308@github.com>

Christian Brabandt

unread,
Mar 23, 2026, 5:05:52 PM (yesterday) Mar 23
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4113700725@github.com>

mattn

unread,
Mar 23, 2026, 8:10:26 PM (yesterday) Mar 23
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4114506534@github.com>

mattn

unread,
Mar 23, 2026, 8:10:42 PM (yesterday) Mar 23
to vim/vim, Push

@mattn pushed 1 commit.

  • 23b584c skip Test_sign_signcolumn_change_no_clear in GUI mode


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/before/a060b31adb10749b393c7e6713b2d395ee93778e/after/23b584c59eff1dc37c8c1707a5bfeb52c111df91@github.com>

mattn

unread,
Mar 23, 2026, 8:20:22 PM (yesterday) Mar 23
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4114552516@github.com>

mattn

unread,
Mar 23, 2026, 8:25:35 PM (yesterday) Mar 23
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4114569904@github.com>

mattn

unread,
Mar 23, 2026, 9:06:45 PM (yesterday) Mar 23
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

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.Message ID: <vim/vim/pull/19713/c4114707754@github.com>

mattn

unread,
Mar 23, 2026, 9:16:16 PM (yesterday) Mar 23
to vim/vim, Subscribed
mattn left a comment (vim/vim#19713)

Here is a summary of the behavior for each case:

  1. Non-GUI + signs present: P_RWINUPD_NOT_VALID (no flicker)
  2. Non-GUI + no signs: P_RWINUPD_NOT_VALID (no flicker)
  3. GUI + signs present: did_set_signcolumn() calls redraw_all_later(UPD_CLEAR) (same as before)
  4. GUI + no signs: P_RWINUPD_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.Message ID: <vim/vim/pull/19713/c4114736249@github.com>

Christian Brabandt

unread,
4:23 PM (7 hours ago) 4:23 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19713)

alright, thanks for clarification


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/c4121123321@github.com>

Christian Brabandt

unread,
4:32 PM (7 hours ago) 4:32 PM
to vim/vim, Subscribed

Closed #19713 via 4292eea.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19713/issue_event/23866418531@github.com>

Reply all
Reply to author
Forward
0 new messages