mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-23 19:46:33 +03:00
Window: add move_cursor_to method
This commit is contained in:
parent
3012f69c4d
commit
5a46ad49ea
@ -142,7 +142,12 @@ void Window::select(bool append, const Selector& selector)
|
||||
|
||||
void Window::move_cursor(const WindowCoord& offset)
|
||||
{
|
||||
BufferCoord target_position = window_to_buffer(m_cursor + offset);
|
||||
move_cursor_to(m_cursor + offset);
|
||||
}
|
||||
|
||||
void Window::move_cursor_to(const WindowCoord& new_pos)
|
||||
{
|
||||
BufferCoord target_position = window_to_buffer(new_pos);
|
||||
|
||||
m_cursor = buffer_to_window(m_buffer.clamp(target_position));
|
||||
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
WindowCoord line_and_column_at(const BufferIterator& iterator) const;
|
||||
|
||||
void move_cursor(const WindowCoord& offset);
|
||||
void move_cursor_to(const WindowCoord& new_pos);
|
||||
|
||||
void empty_selections();
|
||||
void select(bool append, const Selector& selector);
|
||||
|
Loading…
Reference in New Issue
Block a user