Optional verifier for round-trippability, and fix wrapping and tab bugs.
This commit is contained in:
@@ -193,20 +193,22 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const
|
||||
frame.x < f.ds.get_width(); /* let put_cell() handle advance */ ) {
|
||||
last_x = frame.x;
|
||||
put_cell( initialized, frame, f );
|
||||
}
|
||||
|
||||
/* To hint that a word-select should group the end of one line
|
||||
with the beginning of the next, we let the real cursor
|
||||
actually wrap around in cases where it wrapped around for us. */
|
||||
/* To hint that a word-select should group the end of one line
|
||||
with the beginning of the next, we let the real cursor
|
||||
actually wrap around in cases where it wrapped around for us. */
|
||||
|
||||
if ( (frame.cursor_x >= f.ds.get_width())
|
||||
&& (frame.y < f.ds.get_height() - 1)
|
||||
&& f.get_row( frame.y )->get_wrap()
|
||||
&& (!initialized || !frame.last_frame.get_row( frame.y )->get_wrap()) ) {
|
||||
/* next write will wrap */
|
||||
frame.cursor_x = 0;
|
||||
frame.cursor_y++;
|
||||
frame.force_next_put = true;
|
||||
}
|
||||
if ( (frame.y < f.ds.get_height() - 1)
|
||||
&& f.get_row( frame.y )->get_wrap() ) {
|
||||
frame.x = last_x;
|
||||
frame.force_next_put = true;
|
||||
put_cell( initialized, frame, f );
|
||||
|
||||
/* next write will wrap */
|
||||
frame.cursor_x = 0;
|
||||
frame.cursor_y++;
|
||||
frame.force_next_put = true;
|
||||
}
|
||||
|
||||
/* Turn off wrap */
|
||||
@@ -301,8 +303,10 @@ void Display::put_cell( bool initialized, FrameState &frame, const Framebuffer &
|
||||
|
||||
if ( frame.force_next_put ) {
|
||||
frame.append( " " );
|
||||
frame.append_silent_move( frame.y, frame.x );
|
||||
frame.cursor_x++;
|
||||
frame.x++;
|
||||
frame.force_next_put = false;
|
||||
return;
|
||||
}
|
||||
|
||||
/* can we go to the end of the line? */
|
||||
|
||||
Reference in New Issue
Block a user