@ -534,8 +534,16 @@ notcurses_render_internal(notcurses* nc){
// escapes ourselves, if either is set to default, we first send op, and
// then a turnon for whichever aren't default.
// we can elide the default set iff the previous used both defaults
if ( cell_fg_default_p ( & c ) | | cell_bg_default_p ( & c ) ) {
// if our cell has a default foreground *or* background, we can elide the
// default set iff one of:
// * we are a partial glyph, and the previous was default on both, or
// * we are a no-foreground glyph, and the previous was default background, or
// * we are a no-background glyph, and the previous was default foreground
// FIXME move these into the cell bits
bool noforeground = cell_noforeground_p ( & c ) ;
bool nobackground = cell_nobackground_p ( p , & c ) ;
if ( ( ! noforeground & & cell_fg_default_p ( & c ) ) | | ( ! nobackground & & cell_bg_default_p ( & c ) ) ) {
if ( ! nc - > rstate . defaultelidable ) {
+ + nc - > stats . defaultemissions ;
term_emit ( " op " , nc - > op , out , false ) ;
@ -548,8 +556,11 @@ notcurses_render_internal(notcurses* nc){
nc - > rstate . bgelidable = false ;
}
// we can elide the foreground set iff the previous used fg and matched
if ( ! cell_fg_default_p ( & c ) ) {
// if our cell has a non-default foreground, we can elide the non-default
// foreground set iff either:
// * the previous was non-default, and matches what we have now, or
// * we are a no-foreground glyph (iswspace() is true)
if ( /*!noforeground &&*/ ! cell_fg_default_p ( & c ) ) {
cell_get_fg_rgb ( & c , & r , & g , & b ) ;
if ( nc - > rstate . fgelidable & & nc - > rstate . lastr = = r & & nc - > rstate . lastg = = g & & nc - > rstate . lastb = = b ) {
+ + nc - > stats . fgelisions ;
@ -561,7 +572,7 @@ notcurses_render_internal(notcurses* nc){
nc - > rstate . lastr = r ; nc - > rstate . lastg = g ; nc - > rstate . lastb = b ;
nc - > rstate . defaultelidable = false ;
}
if ( ! cell_bg_default_p ( & c ) ) {
if ( ! nobackground & & ! cell_bg_default_p ( & c ) ) {
cell_get_bg_rgb ( & c , & br , & bg , & bb ) ;
if ( nc - > rstate . bgelidable & & nc - > rstate . lastbr = = br & & nc - > rstate . lastbg = = bg & & nc - > rstate . lastbb = = bb ) {
+ + nc - > stats . bgelisions ;