fix cursor column handling
This commit is contained in:
parent
1d12a7fe7d
commit
a93578288e
@ -26,7 +26,6 @@ BufferPane::BufferPane(Window * window, std::shared_ptr<Buffer> buffer)
|
||||
m_buffer_view->set_scroll_offset(5);
|
||||
m_buffer_view->update();
|
||||
m_target_column = 0;
|
||||
m_cursor_virtual_column = 0;
|
||||
m_show_status_bar = true;
|
||||
m_command_mode = false;
|
||||
m_focused = false;
|
||||
@ -104,10 +103,10 @@ void BufferPane::draw_buffer_line(int screen_row, std::shared_ptr<Buffer::Iterat
|
||||
last_drawn_crosshair_row = draw_row;
|
||||
}
|
||||
}
|
||||
else if ((m_cursor_virtual_column >= it.virtual_column()) &&
|
||||
(m_cursor_virtual_column < (it.virtual_column() + cwidth)))
|
||||
else if ((m_buffer_view->cursor_virtual_column() >= it.virtual_column()) &&
|
||||
(m_buffer_view->cursor_virtual_column() < (it.virtual_column() + cwidth)))
|
||||
{
|
||||
int col = it.screen_column() + (m_cursor_virtual_column - it.virtual_column());
|
||||
int col = it.screen_column() + (m_buffer_view->cursor_virtual_column() - it.virtual_column());
|
||||
int row = draw_row;
|
||||
while (col >= m_columns)
|
||||
{
|
||||
@ -141,10 +140,10 @@ void BufferPane::draw_buffer_line(int screen_row, std::shared_ptr<Buffer::Iterat
|
||||
}
|
||||
if (it.is_eol())
|
||||
{
|
||||
if ((m_cursor_virtual_column > it.virtual_column()) &&
|
||||
(m_cursor_virtual_column < (it.virtual_column() + (m_columns - it.screen_column()))))
|
||||
if ((m_buffer_view->cursor_virtual_column() > it.virtual_column()) &&
|
||||
(m_buffer_view->cursor_virtual_column() < (it.virtual_column() + (m_columns - it.screen_column()))))
|
||||
{
|
||||
draw_crosshair(col_x(it.screen_column() + (m_cursor_virtual_column - it.virtual_column())),
|
||||
draw_crosshair(col_x(it.screen_column() + (m_buffer_view->cursor_virtual_column() - it.virtual_column())),
|
||||
row_y(draw_row));
|
||||
}
|
||||
}
|
||||
@ -297,7 +296,7 @@ size_t BufferPane::display_column() const
|
||||
return 0u;
|
||||
}
|
||||
}
|
||||
return m_cursor_virtual_column + 1u;
|
||||
return m_buffer_view->cursor_virtual_column() + 1u;
|
||||
}
|
||||
|
||||
void BufferPane::cursor_move(BufferPane::CursorMovement which)
|
||||
|
@ -80,7 +80,6 @@ protected:
|
||||
int m_scroll_offset;
|
||||
int m_cursor_screen_row;
|
||||
int m_cursor_screen_column;
|
||||
int m_cursor_virtual_column;
|
||||
int m_cursor_row_offset;
|
||||
std::shared_ptr<Buffer::Iterator> m_iterator;
|
||||
std::list<std::pair<int, Buffer::Iterator>> m_screen_lines;
|
||||
|
Loading…
x
Reference in New Issue
Block a user