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)
diff --git a/src/screen.c b/src/screen.c
index 82a0e91..0151888 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1855,8 +1855,17 @@
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 @@
else
#endif
{
+ int is_under;
+
if (screen_attr > HL_ALL) // special HL attr.
{
attrentry_T *aep;
@@ -2030,15 +2041,16 @@
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;