From bb8dc6a6a4bacf417aa6b03d59917c426d83a535 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 21 Jan 2017 12:37:41 -0500 Subject: [PATCH] fix expanding command buffer pane when cursor wraps to next line --- src/gui/BufferPane.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index d127d0c..eb93fdc 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -85,9 +85,11 @@ void BufferPane::walk_line(const Buffer::Iterator & start_of_line, std::function int BufferPane::calculate_rows_in_line(const Buffer::Iterator & start_of_line) { 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) { + walk_line(start_of_line, [this, &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 != Buffer::Iterator::INVALID_CODE_POINT)) + if (m_command_mode || + ((code_point != '\n') && + (code_point != Buffer::Iterator::INVALID_CODE_POINT))) { saved_row_offset = row_offset; }