Mercurial > vim
diff src/screen.c @ 29328:60977de70684 v9.0.0007
patch 9.0.0007: no support for double, dotted and dashed underlines
Commit: https://github.com/vim/vim/commit/84f546363068e4ddfe14a8a2a2322bb8d3a25417
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jun 29 18:39:11 2022 +0100
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 https://github.com/vim/vim/issues/9553)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 29 Jun 2022 19:45:03 +0200 |
parents | b1304512c036 |
children | 9dce192d1ac2 |
line wrap: on
line diff
--- 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;