Add scroll left/right support
This commit is contained in:
parent
8633a37dad
commit
62fdacb757
|
@ -161,6 +161,8 @@ view.
|
|||
* _vb_: scroll to put the main selection on the bottom line of the window
|
||||
* _vj_: scroll the window count line downward
|
||||
* _vk_: scroll the window count line upward
|
||||
* _vh_: scroll the window count columns left
|
||||
* _vl_: scroll the window count columns right
|
||||
|
||||
Multi Selection
|
||||
---------------
|
||||
|
|
|
@ -194,6 +194,12 @@ void view_commands(Context& context)
|
|||
case 'k':
|
||||
context.window().scroll(-std::max<LineCount>(1, context.numeric_param()));
|
||||
break;
|
||||
case 'l':
|
||||
context.window().scroll( std::max<CharCount>(1, context.numeric_param()));
|
||||
break;
|
||||
case 'h':
|
||||
context.window().scroll(-std::max<CharCount>(1, context.numeric_param()));
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -57,6 +57,11 @@ void Window::scroll(LineCount offset)
|
|||
m_position.line = std::max(0_line, m_position.line + offset);
|
||||
}
|
||||
|
||||
void Window::scroll(CharCount offset)
|
||||
{
|
||||
m_position.column = std::max(0_char, m_position.column + offset);
|
||||
}
|
||||
|
||||
void Window::update_display_buffer()
|
||||
{
|
||||
scroll_to_keep_cursor_visible_ifn();
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
void center_selection();
|
||||
void display_selection_at(LineCount line);
|
||||
void scroll(LineCount offset);
|
||||
void scroll(CharCount offset);
|
||||
void update_display_buffer();
|
||||
|
||||
DisplayCoord display_position(const BufferCoord& coord);
|
||||
|
|
Loading…
Reference in New Issue
Block a user