change insert mode cursor

This commit is contained in:
Josh Holtrop 2016-12-24 15:46:31 -05:00
parent 4c412e10d7
commit 239afdfd25

View File

@ -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)