summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-29 18:39:11 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-29 18:39:11 +0100
commit84f546363068e4ddfe14a8a2a2322bb8d3a25417 (patch)
tree3ba03d5c35ce660ee6f437aa2a89948953c362bd /src/screen.c
parent8b5901e2f9466eb6f38f5b251e871f609f65e252 (diff)
downloadvim-git-84f546363068e4ddfe14a8a2a2322bb8d3a25417.tar.gz
patch 9.0.0007: no support for double, dotted and dashed underlinesv9.0.0007
Problem: No support for double, dotted and dashed underlines. Solution: Add the termcap entries and highlight modes. (closes #9553)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c22
1 files changed, 17 insertions, 5 deletions
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;