aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r--src/nvim/eval/funcs.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index fb2465b9fd..df1889b12d 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -11408,14 +11408,22 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
p = highlight_has_attr(id, HL_STANDOUT, modec);
}
break;
- case 'u':
- if (STRLEN(what) <= 5 || TOLOWER_ASC(what[5]) != 'c') { // underline
- p = highlight_has_attr(id, HL_UNDERLINE, modec);
- } else { // undercurl
+ case 'u': {
+ const size_t len = STRLEN(what);
+ if (len <= 5 || (TOLOWER_ASC(what[5]) == 'l' && len <= 9)) { // underline
p = highlight_has_attr(id, HL_UNDERCURL, modec);
+ } else if (TOLOWER_ASC(what[5]) == 'c') { // undercurl
+ p = highlight_has_attr(id, HL_UNDERCURL, modec);
+ } else if (len > 9 && TOLOWER_ASC(what[9]) == 'l') { // underlineline
+ p = highlight_has_attr(id, HL_UNDERLINELINE, modec);
+ } else if (len > 6 && TOLOWER_ASC(what[6]) == 'o') { // underdot
+ p = highlight_has_attr(id, HL_UNDERDOT, modec);
+ } else { // underdash
+ p = highlight_has_attr(id, HL_UNDERDASH, modec);
}
break;
}
+ }
rettv->v_type = VAR_STRING;
rettv->vval.v_string = (char_u *)(p == NULL ? p : xstrdup(p));