From 84f546363068e4ddfe14a8a2a2322bb8d3a25417 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 29 Jun 2022 18:39:11 +0100 Subject: patch 9.0.0007: no support for double, dotted and dashed underlines Problem: No support for double, dotted and dashed underlines. Solution: Add the termcap entries and highlight modes. (closes #9553) --- src/screen.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/screen.c') diff --git a/src/screen.c b/src/screen.c index 82a0e91dd..01518882f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1855,8 +1855,17 @@ screen_start_highlight(int attr) out_str(T_SO); if ((attr & HL_UNDERCURL) && *T_UCS != NUL) // undercurl out_str(T_UCS); - if (((attr & HL_UNDERLINE) // underline or undercurl - || ((attr & HL_UNDERCURL) && *T_UCS == NUL)) + if ((attr & HL_UNDERDOUBLE) && *T_USS != NUL) // double underline + out_str(T_USS); + if ((attr & HL_UNDERDOTTED) && *T_DS != NUL) // dotted underline + out_str(T_DS); + if ((attr & HL_UNDERDASHED) && *T_CDS != NUL) // dashed underline + out_str(T_CDS); + if (((attr & HL_UNDERLINE) // underline or undercurl, etc. + || ((attr & HL_UNDERCURL) && *T_UCS == NUL) + || ((attr & HL_UNDERDOUBLE) && *T_USS == NUL) + || ((attr & HL_UNDERDOTTED) && *T_DS == NUL) + || ((attr & HL_UNDERDASHED) && *T_CDS == NUL)) && *T_US != NUL) out_str(T_US); if ((attr & HL_ITALIC) && *T_CZH != NUL) // italic @@ -1951,6 +1960,8 @@ screen_stop_highlight(void) else #endif { + int is_under; + if (screen_attr > HL_ALL) // special HL attr. { attrentry_T *aep; @@ -2030,15 +2041,16 @@ screen_stop_highlight(void) else out_str(T_SE); } - if ((screen_attr & HL_UNDERCURL) && *T_UCE != NUL) + is_under = (screen_attr & (HL_UNDERCURL + | HL_UNDERDOUBLE | HL_UNDERDOTTED | HL_UNDERDASHED)); + if (is_under && *T_UCE != NUL) { if (STRCMP(T_UCE, T_ME) == 0) do_ME = TRUE; else out_str(T_UCE); } - if ((screen_attr & HL_UNDERLINE) - || ((screen_attr & HL_UNDERCURL) && *T_UCE == NUL)) + if ((screen_attr & HL_UNDERLINE) || (is_under && *T_UCE == NUL)) { if (STRCMP(T_UE, T_ME) == 0) do_ME = TRUE; -- cgit v1.2.1