Change undercurl escape code to 4:x

See https://github.com/neovim/neovim/issues/7479
for discussion. Also implement double underline.
This commit is contained in:
Kovid Goyal
2017-12-04 12:26:50 +05:30
parent 27cd303a05
commit e81ba3b207
5 changed files with 26 additions and 19 deletions

View File

@@ -80,9 +80,9 @@ cursor_from_sgr(Cursor *self, unsigned int *params, unsigned int count) {
case 3:
self->italic = true; break;
case 4:
self->decoration = 1; break;
case UNDERCURL_CODE:
self->decoration = 2; break;
if (i < count) { self->decoration = MIN(3, params[i]); i++; }
else self->decoration = 1;
break;
case 7:
self->reverse = true; break;
case 9:
@@ -143,7 +143,8 @@ static inline const char*
decoration_as_sgr(uint8_t decoration) {
switch(decoration) {
case 1: return "4";
case 2: return "6"; // UNDERCURL_CODE
case 2: return "4:2";
case 3: return "4:3";
default: return "24";
}
}