Draw crosshair for the current line to the end of the screen row
This commit is contained in:
parent
210a7b82c5
commit
9a34bfe4ba
@ -307,28 +307,23 @@ void BufferPane::draw()
|
||||
int BufferPane::draw_buffer_line(int screen_row, const Buffer::Iterator & start_of_line)
|
||||
{
|
||||
int saved_row_offset = 0;
|
||||
walk_line(start_of_line, [this, &saved_row_offset, &screen_row](int row_offset, int screen_column, int virtual_column, int character_width, const Buffer::Iterator & i) {
|
||||
int last_drawn_crosshair_row = -1;
|
||||
walk_line(start_of_line, [this, &saved_row_offset, &screen_row, &last_drawn_crosshair_row](int row_offset, int screen_column, int virtual_column, int character_width, const Buffer::Iterator & i) {
|
||||
uint32_t code_point = *i;
|
||||
int draw_row = screen_row + row_offset;
|
||||
if ((draw_row >= 0) && (draw_row <= m_rows))
|
||||
{
|
||||
if (i.line() == m_iterator->line())
|
||||
{
|
||||
int row = draw_row;
|
||||
int col = screen_column;
|
||||
int c_w = character_width;
|
||||
if (insert_mode() && (code_point == '\n'))
|
||||
if ((code_point != '\n') && (code_point != Buffer::Iterator::INVALID_CODE_POINT))
|
||||
{
|
||||
c_w = 1;
|
||||
if (draw_row > last_drawn_crosshair_row)
|
||||
{
|
||||
for (int col = screen_column; col < m_columns; col++)
|
||||
{
|
||||
draw_crosshair(col_x(col), row_y(draw_row));
|
||||
}
|
||||
for (int i = 0; i < c_w; i++)
|
||||
{
|
||||
draw_crosshair(col_x(col), row_y(row));
|
||||
col++;
|
||||
if (col >= m_columns)
|
||||
{
|
||||
row++;
|
||||
col = 0;
|
||||
last_drawn_crosshair_row = draw_row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user