aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/terminal/terminal.cc
diff options
context:
space:
mode:
authorGravatar John Hood <cgull@glup.org>2016-11-15 21:18:18 -0500
committerGravatar john hood <cgull@glup.org>2016-11-17 00:56:31 -0500
commit302c7deb41ba6b2aadd1975cf1c2b6375675de48 (patch)
tree9feebff5f99faf5e70d2d0c3d5193fda948de224 /src/terminal/terminal.cc
parent71fe4441ef8a7066d1a7279822d1fdacd51524f3 (diff)
Describe Cell width as a narrow/wide boolean.
A character cell can only be either narrow or wide. It's more convenient to represent that as an int containing 1 or 2, but slightly more correct to represent it as a "boolean" single-bit integer.
Diffstat (limited to 'src/terminal/terminal.cc')
-rw-r--r--src/terminal/terminal.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/terminal/terminal.cc b/src/terminal/terminal.cc
index 57a465c..2f9119b 100644
--- a/src/terminal/terminal.cc
+++ b/src/terminal/terminal.cc
@@ -106,7 +106,7 @@ void Emulator::print( const Parser::Print *act )
fb.reset_cell( this_cell );
this_cell->append( ch );
- this_cell->set_width( chwidth );
+ this_cell->set_wide( chwidth == 2 ); /* chwidth had better be 1 or 2 here */
fb.apply_renditions_to_cell( this_cell );
if ( chwidth == 2 ) { /* erase overlapped cell */
@@ -131,7 +131,7 @@ void Emulator::print( const Parser::Print *act )
base character [e.g. start of line], if the
combining character has been cleared with
a sequence like ED ("J") or EL ("K") */
- assert( combining_cell->get_width() == 1 );
+ assert( !combining_cell->get_wide() );
combining_cell->set_fallback( true );
fb.ds.move_col( 1, true, true );
}