record screen layout when drawing

This commit is contained in:
Josh Holtrop 2016-12-25 12:46:06 -05:00
parent 239afdfd25
commit 83a6c1a983
2 changed files with 3 additions and 0 deletions

View File

@ -147,6 +147,7 @@ int BufferPane::update_cursor_row(std::list<std::pair<int, Buffer::Iterator>> &
void BufferPane::draw() void BufferPane::draw()
{ {
m_screen_lines.clear();
if (m_iterator->valid()) if (m_iterator->valid())
{ {
std::list<std::pair<int, Buffer::Iterator>> backward_lines; std::list<std::pair<int, Buffer::Iterator>> backward_lines;
@ -168,6 +169,7 @@ void BufferPane::draw()
} }
while (screen_row <= m_rows) while (screen_row <= m_rows)
{ {
m_screen_lines.push_back(std::pair<int, Buffer::Iterator>(screen_row, i));
screen_row += draw_buffer_line(screen_row, i); screen_row += draw_buffer_line(screen_row, i);
if (!i.go_next_line()) if (!i.go_next_line())
{ {

View File

@ -61,6 +61,7 @@ protected:
int m_cursor_screen_row; int m_cursor_screen_row;
int m_cursor_virtual_column; int m_cursor_virtual_column;
std::shared_ptr<Buffer::Iterator> m_iterator; std::shared_ptr<Buffer::Iterator> m_iterator;
std::list<std::pair<int, Buffer::Iterator>> m_screen_lines;
}; };
#endif #endif