diff --git a/src/core/Buffer.cc b/src/core/Buffer.cc index 53906df..84fdd2f 100644 --- a/src/core/Buffer.cc +++ b/src/core/Buffer.cc @@ -461,3 +461,13 @@ void Buffer::redo() m_current_change_operation_index = child_index; } } + +void Buffer::clear() +{ + m_gap_buffer->clear(); + for (auto iterator : m_iterators) + { + auto b = begin(); + *iterator = b; + } +} diff --git a/src/core/Buffer.h b/src/core/Buffer.h index e70a872..55bed65 100644 --- a/src/core/Buffer.h +++ b/src/core/Buffer.h @@ -119,7 +119,7 @@ public: m_cursors.push_back(iterator); return iterator; } - void clear() { m_gap_buffer->clear(); } + void clear(); auto get_string() { return m_gap_buffer->get_string(); } void set_string(const std::string & s) { m_gap_buffer->set_string(s); } size_t size() const { return m_gap_buffer->size(); }