@@ -388,9 +388,7 @@ bool Display::put_row( bool initialized,
388388 frame.append_silent_move ( frame_y, frame_x - clear_count );
389389 frame.update_rendition ( blank_renditions );
390390 frame.update_hyperlink ( blank_hyperlink );
391- bool can_use_erase
392- = has_bce || ( frame.current_rendition == initial_rendition () && frame.current_hyperlink .empty () );
393- if ( can_use_erase && has_ech && clear_count > 4 ) {
391+ if ( can_use_erase ( frame ) && has_ech && clear_count > 4 ) {
394392 snprintf ( tmp, 64 , " \033 [%dX" , clear_count );
395393 frame.append ( tmp );
396394 } else {
@@ -442,9 +440,7 @@ bool Display::put_row( bool initialized,
442440 frame.update_rendition ( blank_renditions );
443441 frame.update_hyperlink ( blank_hyperlink );
444442
445- bool can_use_erase
446- = has_bce || ( frame.current_rendition == initial_rendition () && frame.current_hyperlink .empty () );
447- if ( can_use_erase && !wrap_this ) {
443+ if ( can_use_erase ( frame ) && !wrap_this ) {
448444 frame.append ( " \033 [K" );
449445 } else {
450446 frame.append ( clear_count, ' ' );
@@ -472,6 +468,11 @@ bool Display::put_row( bool initialized,
472468 return false ;
473469}
474470
471+ bool Display::can_use_erase ( const FrameState& frame ) const
472+ {
473+ return has_bce || ( frame.current_rendition == initial_rendition () && frame.current_hyperlink .empty () );
474+ }
475+
475476FrameState::FrameState ( const Framebuffer& s_last )
476477 : str(), cursor_x( 0 ), cursor_y( 0 ), current_rendition( 0 ), current_hyperlink(),
477478 cursor_visible( s_last.ds.cursor_visible ), last_frame( s_last )
0 commit comments