summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/evalfunc.c4
-rw-r--r--src/highlight.c7
-rw-r--r--src/testdir/test_highlight.vim1
-rw-r--r--src/version.c2
4 files changed, 12 insertions, 2 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 2af4bc00d6..cf1e265330 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -8604,7 +8604,9 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
break;
case 'u':
- if (STRLEN(what) <= 5 || TOLOWER_ASC(what[5]) != 'c')
+ if (TOLOWER_ASC(what[1]) == 'l') // ul
+ p = highlight_color(id, what, modec);
+ else if (STRLEN(what) <= 5 || TOLOWER_ASC(what[5]) != 'c')
// underline
p = highlight_has_attr(id, HL_UNDERLINE, modec);
else
diff --git a/src/highlight.c b/src/highlight.c
index 0a014473b1..56b1988835 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -2684,13 +2684,14 @@ highlight_has_attr(
char_u *
highlight_color(
int id,
- char_u *what, // "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#"
+ char_u *what, // "font", "fg", "bg", "sp", "ul", "fg#", "bg#" or "sp#"
int modec) // 'g' for GUI, 'c' for cterm, 't' for term
{
static char_u name[20];
int n;
int fg = FALSE;
int sp = FALSE;
+ int ul = FALSE;
int font = FALSE;
if (id <= 0 || id > highlight_ga.ga_len)
@@ -2703,6 +2704,8 @@ highlight_color(
font = TRUE;
else if (TOLOWER_ASC(what[0]) == 's' && TOLOWER_ASC(what[1]) == 'p')
sp = TRUE;
+ else if (TOLOWER_ASC(what[0]) == 'u' && TOLOWER_ASC(what[1]) == 'l')
+ ul = TRUE;
else if (!(TOLOWER_ASC(what[0]) == 'b' && TOLOWER_ASC(what[1]) == 'g'))
return NULL;
if (modec == 'g')
@@ -2749,6 +2752,8 @@ highlight_color(
{
if (fg)
n = HL_TABLE()[id - 1].sg_cterm_fg - 1;
+ else if (ul)
+ n = HL_TABLE()[id - 1].sg_cterm_ul - 1;
else
n = HL_TABLE()[id - 1].sg_cterm_bg - 1;
if (n < 0)
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim
index 05f215ae38..8bd03e2da1 100644
--- a/src/testdir/test_highlight.vim
+++ b/src/testdir/test_highlight.vim
@@ -808,6 +808,7 @@ func Test_highlight_ctermul()
call assert_notmatch('ctermul=', HighlightArgs('Normal'))
highlight Normal ctermul=3
call assert_match('ctermul=3', HighlightArgs('Normal'))
+ call assert_equal('3', synIDattr(synIDtrans(hlID('Normal')), 'ul'))
highlight Normal ctermul=NONE
endfunc
diff --git a/src/version.c b/src/version.c
index 26e63c2bd2..d390212d8a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1771,
+/**/
1770,
/**/
1769,