Support scroll up / scroll down (fixes bug w/nano reported by Anders Kaseorg)
This commit is contained in:
@@ -153,14 +153,13 @@ namespace Terminal {
|
|||||||
std::deque<Row> rows;
|
std::deque<Row> rows;
|
||||||
std::vector<wchar_t> window_title;
|
std::vector<wchar_t> window_title;
|
||||||
|
|
||||||
void scroll( int N );
|
|
||||||
|
|
||||||
Row newrow( void ) { return Row( ds.get_width(), ds.get_background_rendition() ); }
|
Row newrow( void ) { return Row( ds.get_width(), ds.get_background_rendition() ); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Framebuffer( int s_width, int s_height );
|
Framebuffer( int s_width, int s_height );
|
||||||
DrawState ds;
|
DrawState ds;
|
||||||
|
|
||||||
|
void scroll( int N );
|
||||||
void move_rows_autoscroll( int rows );
|
void move_rows_autoscroll( int rows );
|
||||||
|
|
||||||
Row *get_row( int row )
|
Row *get_row( int row )
|
||||||
|
|||||||
@@ -474,3 +474,19 @@ void Dispatcher::OSC_dispatch( Parser::OSC_End *act, Framebuffer *fb )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* scroll down or terminfo indn */
|
||||||
|
void CSI_SD( Framebuffer *fb, Dispatcher *dispatch )
|
||||||
|
{
|
||||||
|
fb->scroll( dispatch->getparam( 0, 1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
static Function func_CSI_SD( CSI, "S", CSI_SD );
|
||||||
|
|
||||||
|
/* scroll up or terminfo rin */
|
||||||
|
void CSI_SU( Framebuffer *fb, Dispatcher *dispatch )
|
||||||
|
{
|
||||||
|
fb->scroll( -dispatch->getparam( 0, 1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
static Function func_CSI_SU( CSI, "T", CSI_SU );
|
||||||
|
|||||||
Reference in New Issue
Block a user