Fix broken wrap behavior causing broken copy/paste.

The terminal framebuffer was not resetting the wrap state of a row
when a previously-wrapping line was overwritten by a non-wrapping
line.  Restore previous, subtle behavior of line wrap.  Fix wrap
verification bug now exposed by emulation-wrap-across-frames.test.

Also hoist some getters, mostly for clarity.

Fixes #820.
This commit is contained in:
John Hood
2016-11-14 23:03:29 -05:00
committed by john hood
parent f7f741dab4
commit e4aed30d30
3 changed files with 40 additions and 15 deletions
+13 -4
View File
@@ -42,13 +42,15 @@ Cell::Cell( color_type background_color )
: contents(),
renditions( background_color ),
width( 1 ),
fallback( false )
fallback( false ),
wrap( false )
{}
Cell::Cell() /* default constructor required by C++11 STL */
: contents(),
renditions( 0 ),
width( 1 ),
fallback( false )
fallback( false ),
wrap( false )
{
assert( false );
}
@@ -59,6 +61,7 @@ void Cell::reset( color_type background_color )
renditions = Renditions( background_color );
width = 1;
fallback = false;
wrap = false;
}
void DrawState::reinitialize_tabs( unsigned int start )
@@ -350,11 +353,11 @@ void Framebuffer::delete_line( int row, int count )
}
Row::Row( const size_t s_width, const color_type background_color )
: cells( s_width, Cell( background_color ) ), wrap( false ), gen( get_gen() )
: cells( s_width, Cell( background_color ) ), gen( get_gen() )
{}
Row::Row() /* default constructor required by C++11 STL */
: cells( 1, Cell() ), wrap( false ), gen( get_gen() )
: cells( 1, Cell() ), gen( get_gen() )
{
assert( false );
}
@@ -650,5 +653,11 @@ bool Cell::compare( const Cell &other ) const
fprintf( stderr, "renditions differ\n" );
}
if ( wrap != other.wrap ) {
ret = true;
fprintf( stderr, "wrap: %d vs. %d\n",
wrap, other.wrap );
}
return ret;
}