mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
Properly set italics/struck following sgr #1138
This commit is contained in:
parent
0ed8c0d234
commit
f82ad10667
@ -558,8 +558,9 @@ term_setstyles(FILE* out, uint32_t* curattr, const cell* c, bool* normalized,
|
|||||||
out, false) < 0){
|
out, false) < 0){
|
||||||
ret = -1;
|
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_ITALIC, italics, italoff);
|
||||||
ret |= term_setstyle(out, *curattr, cellattr, NCSTYLE_STRUCK, struck, struckoff);
|
ret |= term_setstyle(out, *curattr, cellattr, NCSTYLE_STRUCK, struck, struckoff);
|
||||||
*curattr = cellattr;
|
*curattr = cellattr;
|
||||||
|
@ -42,6 +42,12 @@ int main(void){
|
|||||||
ncplane_putstr_yx(n, y++, 0, "a ═ struck underline");
|
ncplane_putstr_yx(n, y++, 0, "a ═ struck underline");
|
||||||
ncplane_set_styles(n, NCSTYLE_STRUCK | NCSTYLE_BLINK);
|
ncplane_set_styles(n, NCSTYLE_STRUCK | NCSTYLE_BLINK);
|
||||||
ncplane_putstr_yx(n, y++, 0, "a ═ struck 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...");
|
ncplane_putstr_yx(n, y++, 0, "sleeping for 15s...");
|
||||||
if(notcurses_render(nc)){
|
if(notcurses_render(nc)){
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user