add Buffer::add_cursor()

This commit is contained in:
josh committed 2017-01-07 15:03:51 -05:00
1 parent 924d005020
commit 85dbf75b11
3 files changed
+10 -3

No files matched your search

+7
View File
@@ -105,6 +105,12 @@ public:
m_iterators.push_back(iterator);
return iterator;
}
std::shared_ptr<Iterator> add_cursor()
{
auto iterator = add_iterator();
m_cursors.push_back(iterator);
return iterator;
}
auto get_string() { return m_gap_buffer->get_string(); }
size_t size() const { return m_gap_buffer->size(); }
uint8_t * address(size_t offset) const { return m_gap_buffer->address(offset); }
@@ -130,6 +136,7 @@ protected:
uint8_t m_tabstop;
bool m_insert_mode;
std::list<std::shared_ptr<Iterator>> m_iterators;
std::list<std::shared_ptr<Iterator>> m_cursors;
std::shared_ptr<Iterator> m_eof_iterator;
std::string m_filename;
std::shared_ptr<ChangeOperation> m_current_change_operation;