From a39e1d395634f998828c5199888a0000197a64eb Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 24 Dec 2016 14:57:52 -0500 Subject: [PATCH] fix calculating cursor screen row for multi-row lines --- src/gui/BufferPane.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index 831b7fd..b678c90 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -134,7 +134,7 @@ int BufferPane::update_cursor_row(std::list> & 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);