fix BufferPane::rows_in_line_with_iterator_offset() comparing to reference iterator

This commit is contained in:
Josh Holtrop 2016-12-21 19:07:28 -05:00
parent 9733d577a7
commit 83d4a86e4b

View File

@ -64,6 +64,8 @@ int BufferPane::rows_in_line_with_iterator_offset(const Buffer::Iterator & start
{ {
uint32_t code_point = *i; uint32_t code_point = *i;
if ((code_point == '\n') || (!i.valid())) if ((code_point == '\n') || (!i.valid()))
{
if (i == reference)
{ {
if (screen_column == m_columns) if (screen_column == m_columns)
{ {
@ -73,6 +75,7 @@ int BufferPane::rows_in_line_with_iterator_offset(const Buffer::Iterator & start
{ {
*iterator_row_offset = rows - 1; *iterator_row_offset = rows - 1;
} }
}
break; break;
} }
else if (code_point == '\t') else if (code_point == '\t')
@ -99,6 +102,10 @@ int BufferPane::rows_in_line_with_iterator_offset(const Buffer::Iterator & start
screen_column += c_width; screen_column += c_width;
} }
} }
if (i == reference)
{
*iterator_row_offset = rows;
}
} }
return rows; return rows;
} }