Properly set italics/struck following sgr #1138

pull/1145/head
nick black 4 years ago
parent 0ed8c0d234
commit f82ad10667
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -558,8 +558,9 @@ term_setstyles(FILE* out, uint32_t* curattr, const cell* c, bool* normalized,
out, false) < 0){
ret = -1;
}
// sgr will blow away italics/struck if they were set beforehand
*curattr &= !(NCSTYLE_ITALIC | NCSTYLE_STRUCK);
}
// sgr will blow away italics/struck if they were set beforehand
ret |= term_setstyle(out, *curattr, cellattr, NCSTYLE_ITALIC, italics, italoff);
ret |= term_setstyle(out, *curattr, cellattr, NCSTYLE_STRUCK, struck, struckoff);
*curattr = cellattr;

@ -42,6 +42,12 @@ int main(void){
ncplane_putstr_yx(n, y++, 0, "a ═ struck underline");
ncplane_set_styles(n, NCSTYLE_STRUCK | NCSTYLE_BLINK);
ncplane_putstr_yx(n, y++, 0, "a ═ struck blink");
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_REVERSE);
ncplane_putstr_yx(n, y++, 0, "a ═ bold reverse");
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_UNDERLINE);
ncplane_putstr_yx(n, y++, 0, "a ═ bold underline");
ncplane_set_styles(n, NCSTYLE_BOLD | NCSTYLE_BLINK);
ncplane_putstr_yx(n, y++, 0, "a ═ bold blink");
ncplane_putstr_yx(n, y++, 0, "sleeping for 15s...");
if(notcurses_render(nc)){
goto err;

Loading…
Cancel
Save