BufferPane: remove some cursor-tracking fields that are now tracked by BufferView

This commit is contained in:
Josh Holtrop 2017-09-23 16:12:52 -04:00
parent 8f0b3e4114
commit 6d310f0f14
2 changed files with 1 additions and 12 deletions

View File

@ -19,13 +19,10 @@ int BufferPane::Cwd::operator()(uint32_t character)
BufferPane::BufferPane(Window * window, std::shared_ptr<Buffer> buffer)
: m_window(window), m_buffer(buffer), m_cwd(window)
{
m_cursor_screen_row = 0;
m_scroll_offset = 5;
m_iterator = buffer->add_cursor();
m_buffer_view = std::make_shared<BufferView>(buffer, m_iterator, m_cwd);
m_buffer_view->set_scroll_offset(5);
m_buffer_view->update();
m_target_column = 0;
m_show_status_bar = true;
m_command_mode = false;
m_focused = false;
@ -257,10 +254,7 @@ void BufferPane::insert_code_point(uint32_t code_point)
}
else
{
if (code_point == '\n')
{
m_cursor_screen_row++;
}
/* TODO: adjust cursor screen row in m_buffer_view. */
m_buffer->insert_code_point(*m_iterator, code_point);
}
m_buffer_view->update();

View File

@ -77,13 +77,8 @@ protected:
std::shared_ptr<BufferView> m_buffer_view;
int m_rows;
int m_columns;
int m_scroll_offset;
int m_cursor_screen_row;
int m_cursor_screen_column;
int m_cursor_row_offset;
std::shared_ptr<Buffer::Iterator> m_iterator;
std::list<std::pair<int, Buffer::Iterator>> m_screen_lines;
int m_target_column;
bool m_show_status_bar;
bool m_command_mode;
bool m_focused;