fix calculating cursor screen row for multi-row lines
This commit is contained in:
parent
4d737d09d4
commit
a39e1d3956
@ -134,7 +134,7 @@ int BufferPane::update_cursor_row(std::list<std::pair<int, Buffer::Iterator>> &
|
||||
int rows_in_cursor_line = rows_in_line_with_iterator_offset(start_of_line, *m_iterator, &cursor_row_offset);
|
||||
int so = effective_scroll_offset();
|
||||
int rows_above = screen_rows_above_line(*m_iterator, backward_lines) + cursor_row_offset;
|
||||
int rows_below = screen_rows_below_line(*m_iterator) + std::min(0, rows_in_cursor_line - cursor_row_offset - 1);
|
||||
int rows_below = screen_rows_below_line(*m_iterator) + std::max(0, rows_in_cursor_line - cursor_row_offset - 1);
|
||||
int min_rows_to_leave_above = std::min(rows_above, so);
|
||||
int min_rows_to_leave_below = std::min(rows_below, so);
|
||||
m_cursor_screen_row = std::min(m_rows - min_rows_to_leave_below - 1, m_cursor_screen_row);
|
||||
|
Loading…
x
Reference in New Issue
Block a user