Skip to content

Commit bf0acff

Browse files
committed
patch 8.2.0108: when sign text is changed a manual redraw is needed
Problem: When sign text is changed a manual redraw is needed. (Pontus Lietzler) Solution: Redraw automatically. (closes #5455)
1 parent 4ba6441 commit bf0acff

6 files changed

Lines changed: 24 additions & 4 deletions

File tree

src/sign.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,16 @@ sign_define_by_name(
10251025
else
10261026
sp_prev->sn_next = sp;
10271027
}
1028+
else
1029+
{
1030+
win_T *wp;
1031+
1032+
// Signs may already exist, a redraw is needed in windows with a
1033+
// non-empty sign list.
1034+
FOR_ALL_WINDOWS(wp)
1035+
if (wp->w_buffer->b_signlist != NULL)
1036+
redraw_buf_later(wp->w_buffer, NOT_VALID);
1037+
}
10281038

10291039
// set values for a defined sign.
10301040
if (icon != NULL)
@@ -1781,10 +1791,8 @@ sign_get_placed(
17811791
else
17821792
{
17831793
FOR_ALL_BUFFERS(buf)
1784-
{
17851794
if (buf->b_signlist != NULL)
17861795
sign_get_placed_in_buf(buf, 0, sign_id, sign_group, retlist);
1787-
}
17881796
}
17891797
}
17901798

File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
2+
| +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
3+
|-+0&#ffff4012|)>m+0&#ffffff0@3| @68
4+
| +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
5+
|~+0#4040ff13&| @73
6+
|:+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|
File renamed without changes.

src/testdir/test_signs.vim

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,12 +1747,16 @@ func Test_sign_cursor_position()
17471747
END
17481748
call writefile(lines, 'XtestSigncolumn')
17491749
let buf = RunVimInTerminal('-S XtestSigncolumn', {'rows': 6})
1750-
call VerifyScreenDump(buf, 'Test_sign_cursor_01', {})
1750+
call VerifyScreenDump(buf, 'Test_sign_cursor_1', {})
1751+
1752+
" Change the sign text
1753+
call term_sendkeys(buf, ":sign define s1 text=-)\<CR>")
1754+
call VerifyScreenDump(buf, 'Test_sign_cursor_2', {})
17511755

17521756
" update cursor position calculation
17531757
call term_sendkeys(buf, "lh")
17541758
call term_sendkeys(buf, ":sign unplace 10\<CR>")
1755-
call VerifyScreenDump(buf, 'Test_sign_cursor_02', {})
1759+
call VerifyScreenDump(buf, 'Test_sign_cursor_3', {})
17561760

17571761

17581762
" clean up

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ static char *(features[]) =
742742

743743
static int included_patches[] =
744744
{ /* Add new patch number below this line */
745+
/**/
746+
108,
745747
/**/
746748
107,
747749
/**/

0 commit comments

Comments
 (0)