patch 9.2.0239: signcolumn may cause flicker

Problem:  Changing the 'signcolumn' may cause flicker, because it uses
          the P_RCLR flag for redrawing (Yggdroot)
Solution: Change 'signcolumn' to use P_RWIN instead of P_RCLR, matching
          the behavior of 'number' and 'foldcolumn'
          (Yasuhiro Matsumoto).

fixes:  #19663
closes: #19713

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yasuhiro Matsumoto
2026-03-24 20:25:06 +00:00
committed by Christian Brabandt
parent 9a2260d6cf
commit 4292eea714
20 changed files with 66 additions and 17 deletions
+1 -1
View File
@@ -2416,7 +2416,7 @@ static struct vimoption options[] =
{"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
(char_u *)&p_siso, PV_SISO, NULL, NULL,
{(char_u *)0L, (char_u *)0L} SCTX_INIT},
{"signcolumn", "scl", P_STRING|P_ALLOCED|P_VI_DEF|P_RCLR,
{"signcolumn", "scl", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN,
#ifdef FEAT_SIGNS
(char_u *)VAR_WIN, PV_SCL, did_set_signcolumn, expand_set_signcolumn,
{(char_u *)"auto", (char_u *)0L}
+7
View File
@@ -4080,6 +4080,13 @@ did_set_signcolumn(optset_T *args)
curwin->w_nrwidth_line_count = 0;
# endif
# if defined(FEAT_GUI)
// In the GUI, when sign icons are used, a full screen clear is needed
// to properly redraw the sign icons.
if (gui.in_use && curbuf->b_signlist != NULL)
redraw_all_later(UPD_CLEAR);
# endif
return NULL;
}
+1 -1
View File
@@ -17,4 +17,4 @@
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|1| @5|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|A|l@1
| +0&&@74
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
+1 -1
View File
@@ -17,4 +17,4 @@
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|2|6|-|3|0| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|A|l@1
| +0&&@74
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
+1 -1
View File
@@ -17,4 +17,4 @@
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|4|3|-|4|7| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|A|l@1
| +0&&@74
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
+1 -1
View File
@@ -17,4 +17,4 @@
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|5|9|-|6|4| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|A|l@1
| +0&&@74
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
+1 -1
View File
@@ -17,4 +17,4 @@
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|7|5|-|8|1| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|A|l@1
| +0&&@74
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
+1 -1
View File
@@ -17,4 +17,4 @@
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|i+0#0000000&|n|s|-+0#0000e05&|z+0#0000000&|w|e|i|-+0#0000e05&|d+0#0000000&|r|e|i|-+0#0000e05&|v+0#0000000&|i||+1&&|~+0#4040ff13&| @47
| +0#0000e05#a8a8a8255@3| +0#af5f00255#ffffff0@3|>+0#4040ff13&|e+0#0000000&|r|-+0#0000e05&|f+0#0000000&|ü|n|f|-+0#0000e05&|s+0#0000000&|e|c|h|s|@+0#4040ff13&@2||+1#0000000&|~+0#4040ff13&| @47
|<+3#0000000&|o| |N|a|m|e|]| |[|+|]| |1|,|9|1|-|9|8| @1|T|o|p| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @17|5|,|0|-|1| @9|A|l@1
| +0&&@74
|:+0&&|s|e|t| |b|r|e|a|k|i|n|d|e|n|t| |f|o|l|d|c|o|l|u|m|n|=|2| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @30
+1 -1
View File
@@ -5,4 +5,4 @@
| +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
|~+0#4040ff13&| @58
| +0#0000000&@41|1|,|7|6|-|9|2| @6|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @22|1|,|7|6|-|9|2| @6|A|l@1|
+1 -1
View File
@@ -5,4 +5,4 @@
| +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
|~+0#4040ff13&| @58
| +0#0000000&@41|2|,|7|-|1|9| @7|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @22|2|,|7|-|1|9| @7|A|l@1|
+1 -1
View File
@@ -5,4 +5,4 @@
| +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
|~+0#4040ff13&| @58
| +0#0000000&@41|3|,|1|3|-|1|6| @6|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @22|3|,|1|3|-|1|6| @6|A|l@1|
+1 -1
View File
@@ -5,4 +5,4 @@
| +0#0000e05#a8a8a8255@1|e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
|~+0#4040ff13&| @58
| +0#0000000&@41|3|,|1|6|-|2@1| @6|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @22|3|,|1|6|-|2@1| @6|A|l@1|
+1 -1
View File
@@ -5,4 +5,4 @@
| +0#0000e05#a8a8a8255@1>e+0#ffffff16#e000002|m|p|t|y| |l|i|n|e| +0#0000000#ffffff0@47
| +0#0000e05#a8a8a8255@1|l+0#0000000#ffffff0|o@1|k| |n|o| |h|i|g|h|l|i|g|h|t| @40
|~+0#4040ff13&| @58
| +0#0000000&@41|4|,|0|-|1| @8|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @22|4|,|0|-|1| @8|A|l@1|
+1 -1
View File
@@ -7,4 +7,4 @@
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|,|1| @10|A|l@1|
|:+0#0000000&|c|a|l@1| |A|d@1|M|a|t|c|h|(|)| @40|1|,|1| @10|A|l@1|
+1 -1
View File
@@ -5,4 +5,4 @@
|~+0#4040ff13&| @73
|~| @73
|~| @73
| +0#0000000&@56|2|,|8| @10|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @37|2|,|8| @10|A|l@1|
+1 -1
View File
@@ -6,4 +6,4 @@
| +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|3| |f+0#0000000&|i|v|e| |s|i|x| @45
|~+0#4040ff13&| @58
|~| @58
| +0#0000000&@41|1|,|9|-|1@1|7| @6|A|l@1|
|:+0#0000000&|s|e|t| |n|u|m|b|e|r| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| @15|1|,|9|-|1@1|7| @6|A|l@1|
+1 -1
View File
@@ -9,4 +9,4 @@
|~+0#4040ff13&| @58
|~| @58
|~| @58
| +0#0000000&@41|3|,|5| @10|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| |f|o|l|d|c|o|l|u|m|n|=|3| |c|u|r|s|o|r|l|i|n|3|,|5| @10|A|l@1|
+1 -1
View File
@@ -9,4 +9,4 @@
|~+0#4040ff13#ffffff0| @58
|~| @58
|~| @58
| +0#0000000&@41|4|,|4| @10|A|l@1|
|:+0#0000000&|s|e|t| |s|i|g|n|c|o|l|u|m|n|=|y|e|s| |f|o|l|d|c|o|l|u|m|n|=|3| @9|4|,|4| @10|A|l@1|
+40
View File
@@ -2121,4 +2121,44 @@ func Test_sign_number_without_signtext()
call StopVimInTerminal(buf)
endfunc
func Test_sign_signcolumn_change_no_clear()
" In the GUI, sign icons need UPD_CLEAR to redraw properly,
" so this optimization only applies to non-GUI mode.
CheckNotGui
new
call setline(1, ['a', 'b', 'c'])
set number signcolumn=auto
sign define SignA text=>> texthl=Search
exe 'sign place 1 line=1 name=SignA buffer=' .. bufnr()
redraw!
" Put a marker on the command line
echon 'SIGNTEST'
" Change signcolumn - with P_RWIN this should NOT trigger UPD_CLEAR,
" so the command line should retain the marker text.
" With P_RCLR, UPD_CLEAR would blank the entire screen including
" the command line, causing the marker to disappear.
set signcolumn=number
redraw
" Verify sign and number column are correctly displayed after the change.
" Line 1 has sign '>>' shown in the number column.
" Line 2 has no sign, so line number '2' is shown.
call assert_equal(' >> a', s:ScreenLine(1, 1, 5))
call assert_equal(' 2 b', s:ScreenLine(2, 1, 5))
" Verify the command line was NOT cleared (P_RWIN does not trigger
" UPD_CLEAR, unlike P_RCLR).
let cmdline = ''
for i in range(1, 8)
let cmdline ..= screenstring(&lines, i)
endfor
call assert_equal('SIGNTEST', cmdline)
sign unplace * group=*
sign undefine SignA
set signcolumn& number&
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
239,
/**/
238,
/**/