]> granicus.if.org Git - vim/commitdiff
patch 8.2.0108: when sign text is changed a manual redraw is needed v8.2.0108
authorBram Moolenaar <Bram@vim.org>
Thu, 9 Jan 2020 20:01:59 +0000 (21:01 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 9 Jan 2020 20:01:59 +0000 (21:01 +0100)
Problem:    When sign text is changed a manual redraw is needed. (Pontus
            Lietzler)
Solution:   Redraw automatically. (closes #5455)

src/sign.c
src/testdir/dumps/Test_sign_cursor_1.dump [moved from src/testdir/dumps/Test_sign_cursor_01.dump with 100% similarity]
src/testdir/dumps/Test_sign_cursor_2.dump [new file with mode: 0644]
src/testdir/dumps/Test_sign_cursor_3.dump [moved from src/testdir/dumps/Test_sign_cursor_02.dump with 100% similarity]
src/testdir/test_signs.vim
src/version.c

index 935ec3c74de62175bbe8017c8dabe63e0be44bdd..9d8d7ac8a371da136918b69f0e6207ccaa7b726b 100644 (file)
@@ -1025,6 +1025,16 @@ sign_define_by_name(
        else
            sp_prev->sn_next = sp;
     }
+    else
+    {
+       win_T *wp;
+
+       // Signs may already exist, a redraw is needed in windows with a
+       // non-empty sign list.
+       FOR_ALL_WINDOWS(wp)
+           if (wp->w_buffer->b_signlist != NULL)
+               redraw_buf_later(wp->w_buffer, NOT_VALID);
+    }
 
     // set values for a defined sign.
     if (icon != NULL)
@@ -1781,10 +1791,8 @@ sign_get_placed(
     else
     {
        FOR_ALL_BUFFERS(buf)
-       {
            if (buf->b_signlist != NULL)
                sign_get_placed_in_buf(buf, 0, sign_id, sign_group, retlist);
-       }
     }
 }
 
diff --git a/src/testdir/dumps/Test_sign_cursor_2.dump b/src/testdir/dumps/Test_sign_cursor_2.dump
new file mode 100644 (file)
index 0000000..2d10a2c
--- /dev/null
@@ -0,0 +1,6 @@
+| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
+|-+0&#ffff4012|)>m+0&#ffffff0@3| @68
+| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
+|~+0#4040ff13&| @73
+|:+0#0000000&|s|i|g|n| |d|e|f|i|n|e| |s|1| |t|e|x|t|=|-|)| @33|2|,|1| @10|A|l@1| 
index 862199cd3c88d5257c090ddece148808db9920bc..d480671d279c9f0775a3bc92eebfa888924d9591 100644 (file)
@@ -1747,12 +1747,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
index f15d748dc5f8ff64540c413e99e2bbd5acb2e808..e06dfc6d1cfdd5e5f2a610e4ab1f14c508902ccd 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    108,
 /**/
     107,
 /**/