From 8181d8343b430bb8bf06f94616d6c7f6409bbc33 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 29 Dec 2016 19:42:46 -0500 Subject: [PATCH] change cursor width to highlight full character for multi-column characters --- src/gui/BufferPane.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index 9747b89..91d60c7 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -223,8 +223,20 @@ int BufferPane::draw_buffer_line(int screen_row, const Buffer::Iterator & start_ { if (i == *m_iterator) { - /* TODO: highlight multi-column characters */ - draw_cursor(x, y); + bool wrap = (code_point == '\t'); + int row = draw_row; + int col = screen_column; + int w = character_width; + while (w--) + { + draw_cursor(col_x(col), row_y(row)); + col++; + if (wrap && (col >= m_columns)) + { + row++; + col = 0; + } + } } if ((code_point == '\n') || (code_point == Buffer::Iterator::INVALID_CODE_POINT)) {