0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 9.0.1067: in diff mode virtual text is highlighted incorrectly

Problem:    In diff mode virtual text is highlighted incorrectly. (Rick Howe)
Solution:   Do not use diff attributes for virtual text. (closes #11714)
This commit is contained in:
Bram Moolenaar
2022-12-17 11:33:00 +00:00
parent 67f3094397
commit d097af7779
5 changed files with 56 additions and 2 deletions

View File

@@ -2206,11 +2206,13 @@ win_line(
#ifdef FEAT_DIFF
if (wlv.diff_hlf != (hlf_T)0)
{
// When there is extra text (e.g. virtual text) it gets the
// diff highlighting for the line, but not for changed text.
if (wlv.diff_hlf == HLF_CHD && ptr - line >= change_start
&& wlv.n_extra == 0)
wlv.diff_hlf = HLF_TXD; // changed text
if (wlv.diff_hlf == HLF_TXD && ptr - line > change_end
&& wlv.n_extra == 0)
if (wlv.diff_hlf == HLF_TXD && (ptr - line > change_end
|| wlv.n_extra > 0))
wlv.diff_hlf = HLF_CHD; // changed line
wlv.line_attr = HL_ATTR(wlv.diff_hlf);
if (wp->w_p_cul && lnum == wp->w_cursor.lnum