patch 8.1.1717: last char in menu popup window highlighted
Problem: Last char in menu popup window highlighted.
Solution: Do not highlight an extra character twice.
diff --git a/src/screen.c b/src/screen.c
index fdb1e0a..5cffdf1 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3219,10 +3219,10 @@
int syntax_attr = 0; /* attributes desired by syntax */
int has_syntax = FALSE; /* this buffer has syntax highl. */
int save_did_emsg;
- int eol_hl_off = 0; /* 1 if highlighted char after EOL */
int draw_color_col = FALSE; /* highlight colorcolumn */
int *color_cols = NULL; /* pointer to according columns array */
#endif
+ int eol_hl_off = 0; /* 1 if highlighted char after EOL */
#ifdef FEAT_TEXT_PROP
int text_prop_count;
int text_prop_next = 0; // next text property to use
@@ -5557,11 +5557,11 @@
/*
* At end of the text line or just after the last character.
*/
- if (c == NUL
+ if ((c == NUL
#if defined(LINE_ATTR)
|| did_line_attr == 1
#endif
- )
+ ) && eol_hl_off == 0)
{
#ifdef FEAT_SEARCH_EXTRA
long prevcol = (long)(ptr - line) - (c == NUL);
@@ -5687,9 +5687,7 @@
++off;
}
++vcol;
-#ifdef FEAT_SYN_HL
eol_hl_off = 1;
-#endif
}
}