csi: move 'dim' attribute from 'vt' to cell attributes

This commit is contained in:
Daniel Eklöf 2019-07-16 13:25:45 +02:00
parent 6c6543cfeb
commit 770c5e97dd
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 3 additions and 4 deletions

5
csi.c
View file

@ -111,7 +111,6 @@ static void
sgr_reset(struct terminal *term) sgr_reset(struct terminal *term)
{ {
memset(&term->vt.attrs, 0, sizeof(term->vt.attrs)); memset(&term->vt.attrs, 0, sizeof(term->vt.attrs));
term->vt.dim = false;
term->vt.attrs.foreground = term->foreground; term->vt.attrs.foreground = term->foreground;
term->vt.attrs.background = term->background; term->vt.attrs.background = term->background;
} }
@ -160,7 +159,7 @@ csi_sgr(struct terminal *term)
break; break;
case 1: term->vt.attrs.bold = true; break; case 1: term->vt.attrs.bold = true; break;
case 2: term->vt.dim = true; break; case 2: term->vt.attrs.dim = true; break;
case 3: term->vt.attrs.italic = true; break; case 3: term->vt.attrs.italic = true; break;
case 4: term->vt.attrs.underline = true; break; case 4: term->vt.attrs.underline = true; break;
case 5: term->vt.attrs.blink = true; break; case 5: term->vt.attrs.blink = true; break;
@ -170,7 +169,7 @@ csi_sgr(struct terminal *term)
case 9: term->vt.attrs.strikethrough = true; break; case 9: term->vt.attrs.strikethrough = true; break;
case 21: term->vt.attrs.bold = false; break; case 21: term->vt.attrs.bold = false; break;
case 22: term->vt.attrs.bold = term->vt.dim = false; break; case 22: term->vt.attrs.bold = term->vt.attrs.dim = false; break;
case 23: term->vt.attrs.italic = false; break; case 23: term->vt.attrs.italic = false; break;
case 24: term->vt.attrs.underline = false; break; case 24: term->vt.attrs.underline = false; break;
case 25: term->vt.attrs.blink = false; break; case 25: term->vt.attrs.blink = false; break;

View file

@ -52,6 +52,7 @@ struct rgb { float r, g, b; };
* misses) */ * misses) */
struct attributes { struct attributes {
uint8_t bold:1; uint8_t bold:1;
uint8_t dim:1;
uint8_t italic:1; uint8_t italic:1;
uint8_t underline:1; uint8_t underline:1;
uint8_t strikethrough:1; uint8_t strikethrough:1;
@ -134,7 +135,6 @@ struct vt {
} utf8; } utf8;
struct attributes attrs; struct attributes attrs;
struct attributes saved_attrs; struct attributes saved_attrs;
bool dim;
}; };
struct kbd { struct kbd {