From 83d4a86e4bc819443eaea1d2108daed1d87f68b7 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 21 Dec 2016 19:07:28 -0500 Subject: [PATCH] fix BufferPane::rows_in_line_with_iterator_offset() comparing to reference iterator --- src/gui/BufferPane.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index 2b851f1..4434943 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -65,13 +65,16 @@ int BufferPane::rows_in_line_with_iterator_offset(const Buffer::Iterator & start uint32_t code_point = *i; if ((code_point == '\n') || (!i.valid())) { - if (screen_column == m_columns) + if (i == reference) { - *iterator_row_offset = rows; - } - else - { - *iterator_row_offset = rows - 1; + if (screen_column == m_columns) + { + *iterator_row_offset = rows; + } + else + { + *iterator_row_offset = rows - 1; + } } break; } @@ -99,6 +102,10 @@ int BufferPane::rows_in_line_with_iterator_offset(const Buffer::Iterator & start screen_column += c_width; } } + if (i == reference) + { + *iterator_row_offset = rows; + } } return rows; }