]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0239: signcolumn may cause flicker v9.2.0239
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Tue, 24 Mar 2026 20:25:06 +0000 (20:25 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 24 Mar 2026 20:25:06 +0000 (20:25 +0000)
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>
20 files changed:
src/optiondefs.h
src/optionstr.c
src/testdir/dumps/Test_Xcursorline_13.dump
src/testdir/dumps/Test_Xcursorline_14.dump
src/testdir/dumps/Test_Xcursorline_15.dump
src/testdir/dumps/Test_Xcursorline_16.dump
src/testdir/dumps/Test_Xcursorline_17.dump
src/testdir/dumps/Test_Xcursorline_18.dump
src/testdir/dumps/Test_prop_inserts_text_2.dump
src/testdir/dumps/Test_prop_inserts_text_3.dump
src/testdir/dumps/Test_prop_inserts_text_4.dump
src/testdir/dumps/Test_prop_inserts_text_5.dump
src/testdir/dumps/Test_prop_inserts_text_6.dump
src/testdir/dumps/Test_prop_linebreak_2.dump
src/testdir/dumps/Test_prop_right_align_twice_3.dump
src/testdir/dumps/Test_prop_with_text_above_4.dump
src/testdir/dumps/Test_prop_with_text_after_nowrap_2.dump
src/testdir/dumps/Test_prop_with_text_after_nowrap_3.dump
src/testdir/test_signs.vim
src/version.c

index a40c4a77f40ef0ec71ce18531b7516296ada99c4..33d0a711032a135428e3c0ae4241dcd8fdf6b20b 100644 (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}
index 8fefcb035326c0053b22d03d3993b0eead01c84f..8f964b9837d7367765d6e01a665602636da62b6a 100644 (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;
 }
 
index 16cac6ad69c8440bbf83b1914dc4489012e70245..a368585b31616b48bd1248c59ed0d43ef2fcc0df 100644 (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
index c6c8b7eb50cdd035004dbd7b3216ef62068cc842..2e2d701d3bac8f5d980dedf1dc31d509eb55e06c 100644 (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
index fc3b62f0a1c48c3147a3df927464dd4f55d71755..881dfd5e764266ce5051515e9ab3e65a40c8c3e2 100644 (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
index 998205643231db22c311559602b82b9643f8a170..d8636aebb4069857f74c2da3c83625e032041939 100644 (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
index 9639e15e4be61f185d05afd0c382684a5d7e8fa2..f3a631cf187191ae76066f820d12f0fd4982adf5 100644 (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
index 4af55f2d50b4258102b6be20f82137e6d439ae88..ba6f379e57c1ccbb6ca74f60c1f18f80d29a3c42 100644 (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
index c9c325f8baa49cf529ef42afa785406dbafcbda5..aa3fc6f285a2ec1f979e458c885655e07aba69f1 100644 (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| 
index 2b935540f410f0611f045dd24b44a8e86c662bd4..2866105f2ecd064e0d045f345c47eaafba02cd96 100644 (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| 
index 83e656a27af34bfcc64e51e7823567a1b647cf36..d42bc833ec546869c7311f996885c86bb456a8f7 100644 (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| 
index 2885d4d08a448758b14e9a4fb5161a7eb150d0d8..bf2203d58dbb3a2a6b2a7cc1908aeaf59f7fbba8 100644 (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| 
index 5aeddb4da10287081503c303639b655cb0d38512..9b4bfa1cfc3e083ee52354d45e51372b3cce00ed 100644 (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| 
index e705f7193818138b601925ce82903db4d0ffaaf4..e16fa7e5ab2e964793e96b048811ae28f2880a31 100644 (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| 
index 2c4cbeee54c96eff8ab55330cb475382c4b41136..23839bc58a857414aadf35448e94e8007bc6e439 100644 (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| 
index 2a207ebe7e9bae6a26ab5b1dfc703ba897dd4579..06040a8d5ad02bd13c10694139c805cce04e7dc8 100644 (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| 
index 1d5c534834d9c799308803773754f5a479efd4f6..b981380606c6eed8ddbd437a4ca0d865139a9cdc 100644 (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| 
index ca849123a5b96b6f2beedc5f8f0c276fa842bd92..5342f5ba1625f90d699362c8bc3a5bcfb6ebcb37 100644 (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| 
index 83cfc5f2f1ab6375a7cacbc4bb024c02859dd638..bde3d047606c23e7e8b9e8c94e0e7e19b84d48d5 100644 (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
index 67feb77dd742798d76f21d37fe3f5968a4cfd108..c8c3fbc594dd327f0070bfc84c1a9a43095fc7c2 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    239,
 /**/
     238,
 /**/