vim-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 vim/vim#5455)
bf0acff012
This commit is contained in:
Jan Edmund Lazo 2020-02-26 02:07:35 -05:00
parent c40bb2de7a
commit 4ccbc8d56e
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 14 additions and 2 deletions

View File

@ -831,6 +831,14 @@ int sign_define_by_name(
} else {
sp_prev->sn_next = sp;
}
} else {
// Signs may already exist, a redraw is needed in windows with a
// non-empty sign list.
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (wp->w_buffer->b_signlist != NULL) {
redraw_buf_later(wp->w_buffer, NOT_VALID);
}
}
}
// set values for a defined sign.

View File

@ -1726,12 +1726,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