From 239afdfd2513f4fac25f5bd7b0bab74874957191 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 24 Dec 2016 15:46:31 -0500 Subject: [PATCH] change insert mode cursor --- src/gui/BufferPane.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/BufferPane.cc b/src/gui/BufferPane.cc index c36df5a..4a4519e 100644 --- a/src/gui/BufferPane.cc +++ b/src/gui/BufferPane.cc @@ -246,9 +246,18 @@ void BufferPane::draw_buffer_character(int screen_column, int screen_row, uint32 void BufferPane::draw_cursor(int x, int y, bool insert_mode) { - int width = insert_mode ? 1 : m_window->font()->get_advance(); + int width = m_window->font()->get_advance(); int height = m_window->font()->get_line_height(); - m_window->gl()->draw_rect(win_x(x), win_y(y), width, height, 1.0, 0.2, 1.0, 1.0); + if (insert_mode) + { + m_window->gl()->draw_rect(win_x(x), win_y(y), 1, height, 1.0, 0.2, 1.0, 1.0); + m_window->gl()->draw_rect(win_x(x + 1), win_y(y + height - 1), 2, 1, 1.0, 0.2, 1.0, 1.0); + m_window->gl()->draw_rect(win_x(x + 1), win_y(y), 2, 1, 1.0, 0.2, 1.0, 1.0); + } + else + { + m_window->gl()->draw_rect(win_x(x), win_y(y), width, height, 1.0, 0.2, 1.0, 1.0); + } } void BufferPane::handle_key(uint32_t keyval)