1
0
forked from aniani/vim

patch 8.2.1693: "hi def" does not work for cleared highlight

Problem:    "hi def" does not work for cleared highlight.
Solution:   Check the "sg_cleared" flag. (Maxim Kim, closes #6956,
            closes #4405)
This commit is contained in:
Bram Moolenaar
2020-09-16 15:43:21 +02:00
parent fb489af2ec
commit 05eb5b9cae
3 changed files with 38 additions and 2 deletions

View File

@@ -729,7 +729,8 @@ do_highlight(
if (!ends_excmd2(line, skipwhite(to_end)))
{
semsg(_("E413: Too many arguments: \":highlight link %s\""), from_start);
semsg(_("E413: Too many arguments: \":highlight link %s\""),
from_start);
return;
}
@@ -1629,7 +1630,8 @@ restore_cterm_colors(void)
static int
hl_has_settings(int idx, int check_link)
{
return ( HL_TABLE()[idx].sg_term_attr != 0
return HL_TABLE()[idx].sg_cleared == 0
&& ( HL_TABLE()[idx].sg_term_attr != 0
|| HL_TABLE()[idx].sg_cterm_attr != 0
|| HL_TABLE()[idx].sg_cterm_fg != 0
|| HL_TABLE()[idx].sg_cterm_bg != 0