cursor positioning fix

This commit is contained in:
Josh Holtrop 2016-12-24 14:25:25 -05:00
parent dce5e68941
commit 3c73b9ae97

View File

@ -137,7 +137,10 @@ int BufferPane::update_cursor_row(std::list<std::pair<int, Buffer::Iterator>> &
int rows_below = screen_rows_below_line(*m_iterator) + std::min(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::max(min_rows_to_leave_above, std::min(m_rows - min_rows_to_leave_below - 1, m_cursor_screen_row));
m_cursor_screen_row = std::min(m_rows - min_rows_to_leave_below - 1, m_cursor_screen_row);
m_cursor_screen_row = std::max(min_rows_to_leave_above, m_cursor_screen_row);
m_cursor_screen_row = std::max(m_rows - rows_below - 1, m_cursor_screen_row);
m_cursor_screen_row = std::min(rows_above, m_cursor_screen_row);
return cursor_row_offset;
}