Fix tabbing bug
This commit is contained in:
@@ -236,3 +236,16 @@ int DrawState::limit_bottom( void )
|
|||||||
{
|
{
|
||||||
return origin_mode ? scrolling_region_bottom_row : height - 1;
|
return origin_mode ? scrolling_region_bottom_row : height - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<int> DrawState::get_tabs( void )
|
||||||
|
{
|
||||||
|
std::vector<int> ret;
|
||||||
|
|
||||||
|
for ( int i = 0; i < width; i++ ) {
|
||||||
|
if ( tabs[ i ] ) {
|
||||||
|
ret.push_back( i );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ namespace Terminal {
|
|||||||
void clear_tab( int col );
|
void clear_tab( int col );
|
||||||
int get_next_tab( void );
|
int get_next_tab( void );
|
||||||
|
|
||||||
|
std::vector<int> get_tabs( void );
|
||||||
|
|
||||||
void set_scrolling_region( int top, int bottom );
|
void set_scrolling_region( int top, int bottom );
|
||||||
|
|
||||||
int limit_top( void );
|
int limit_top( void );
|
||||||
|
|||||||
@@ -163,12 +163,16 @@ static Function func_Ctrl_HTS( CONTROL, "\x88", Ctrl_HTS );
|
|||||||
|
|
||||||
void CSI_TBC( Framebuffer *fb, Dispatcher *dispatch )
|
void CSI_TBC( Framebuffer *fb, Dispatcher *dispatch )
|
||||||
{
|
{
|
||||||
if ( dispatch->getparam( 0, 0 ) == 3 ) { /* clear all tab stops */
|
int param = dispatch->getparam( 0, 0 );
|
||||||
|
switch ( param ) {
|
||||||
|
case 0: /* clear this tab stop */
|
||||||
|
fb->ds.clear_tab( fb->ds.get_cursor_col() );
|
||||||
|
break;
|
||||||
|
case 3: /* clear all tab stops */
|
||||||
for ( int x = 0; x < fb->ds.get_width(); x++ ) {
|
for ( int x = 0; x < fb->ds.get_width(); x++ ) {
|
||||||
fb->ds.clear_tab( x );
|
fb->ds.clear_tab( x );
|
||||||
}
|
}
|
||||||
} else {
|
break;
|
||||||
fb->ds.clear_tab( fb->ds.get_cursor_col() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user