From b40a5e243ba6bf1891a05f66a929b7e096f696de Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 24 Dec 2016 13:57:26 -0500 Subject: [PATCH] fix row count for empty rows --- src/gui/BufferPane.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index 5cd8ade..8188b15 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -74,7 +74,7 @@ void BufferPane::walk_line(const Buffer::Iterator & start_of_line, std::function int BufferPane::rows_in_line(const Buffer::Iterator & start_of_line) { - int saved_row_offset; + int saved_row_offset = 0; walk_line(start_of_line, [&saved_row_offset](int row_offset, int screen_column, int virtual_column, int character_width, const Buffer::Iterator & i) { uint32_t code_point = *i; if ((code_point != '\n') && (code_point != 0xFFFFFFFFu)) @@ -87,7 +87,7 @@ int BufferPane::rows_in_line(const Buffer::Iterator & start_of_line) int BufferPane::rows_in_line_with_iterator_offset(const Buffer::Iterator & start_of_line, const Buffer::Iterator & reference, int * iterator_row_offset) { - int saved_row_offset; + int saved_row_offset = 0; walk_line(start_of_line, [&saved_row_offset, &reference, &iterator_row_offset](int row_offset, int screen_column, int virtual_column, int character_width, const Buffer::Iterator & i) { uint32_t code_point = *i; if (i == reference)