fix Buffer::clear() to update iterators
This commit is contained in:
parent
47d15ca858
commit
276c756bb7
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user