Move grapheme printing from FrameState::append_cell() to Framebuffer::Cell::print_grapheme().
This commit is contained in:
@@ -113,6 +113,7 @@ namespace Terminal {
|
||||
|
||||
bool is_blank( void ) const
|
||||
{
|
||||
// XXX fix.
|
||||
return ( contents.empty()
|
||||
|| contents == " "
|
||||
|| contents == "\xC2\xA0" );
|
||||
@@ -161,6 +162,22 @@ namespace Terminal {
|
||||
size_t len = wcrtomb(tmp, c, &ps);
|
||||
contents.insert( contents.end(), tmp, tmp+len );
|
||||
}
|
||||
|
||||
void print_grapheme( std::string &output ) const
|
||||
{
|
||||
if ( cell.contents.empty() ) {
|
||||
output.append( ' ' );
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* cells that begin with combining character get combiner
|
||||
* attached to no-break space
|
||||
*/
|
||||
if ( cell.fallback ) {
|
||||
output.append( "\xC2\xA0" );
|
||||
}
|
||||
output.append( cell.contents );
|
||||
}
|
||||
};
|
||||
|
||||
class Row {
|
||||
|
||||
Reference in New Issue
Block a user