mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-21 02:21:32 +03:00
add Window::center_selection method
This commit is contained in:
parent
45b9ac6087
commit
c9a7cf50f3
@ -35,6 +35,12 @@ Window::~Window()
|
||||
m_option_manager.unregister_watcher(*this);
|
||||
}
|
||||
|
||||
void Window::center_selection()
|
||||
{
|
||||
BufferIterator cursor = selections().back().last();
|
||||
m_position.line = std::max(0, cursor.line() - m_dimensions.line/2);
|
||||
}
|
||||
|
||||
void Window::update_display_buffer()
|
||||
{
|
||||
scroll_to_keep_cursor_visible_ifn();
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
|
||||
const DisplayBuffer& display_buffer() const { return m_display_buffer; }
|
||||
|
||||
void center_selection();
|
||||
void update_display_buffer();
|
||||
|
||||
String status_line() const;
|
||||
|
Loading…
Reference in New Issue
Block a user