draw cursor at end of line when in insert mode
This commit is contained in:
parent
65dea7f84f
commit
1f3ecf950f
@ -444,7 +444,20 @@ void Window::draw_buffer()
|
||||
(character != '\n'))
|
||||
draw_buffer_character(screen_column, screen_row, character);
|
||||
}
|
||||
if (!cursor.check_go_right(1, false))
|
||||
bool eol = !cursor.check_go_right(1, true);
|
||||
bool draw_insert_mode_cursor = false;
|
||||
if (!eol && *cursor == PieceTable::INTERNAL_EOL)
|
||||
{
|
||||
if ((cursor == *m_cursor) && m_buffer->piece_table->in_insert_mode())
|
||||
{
|
||||
row_offset = cursor.column / m_columns;
|
||||
screen_row = row + row_offset;
|
||||
screen_column = cursor.column % m_columns;
|
||||
draw_insert_mode_cursor = true;
|
||||
}
|
||||
eol = true;
|
||||
}
|
||||
if (eol)
|
||||
{
|
||||
bool last_row = !cursor.check_go_down(1, 0);
|
||||
if (last_vertical_crosshair_row < row)
|
||||
@ -456,6 +469,10 @@ void Window::draw_buffer()
|
||||
}
|
||||
last_vertical_crosshair_row = row;
|
||||
}
|
||||
if (draw_insert_mode_cursor)
|
||||
{
|
||||
draw_cursor(screen_column, screen_row, true);
|
||||
}
|
||||
if (last_row)
|
||||
break;
|
||||
row = screen_row + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user