fix bug dealing with coalescing erase change units within one change operation
This commit is contained in:
parent
da2bafd563
commit
3b1bea80aa
@ -326,6 +326,7 @@ void Buffer::record_change(size_t offset, size_t length, bool insert)
|
||||
{
|
||||
/* The new deletion immediately precedes the previous. */
|
||||
m_gap_buffer->copy_to(offset, length, *m_change_buffer, cu.change_buffer_offset);
|
||||
cu.buffer_position = offset;
|
||||
}
|
||||
cu.length += length;
|
||||
return;
|
||||
@ -388,6 +389,7 @@ void Buffer::apply_change_unit(const ChangeUnit & change_unit, bool forward)
|
||||
{
|
||||
if (forward == change_unit.insert)
|
||||
{
|
||||
m_change_buffer->compact();
|
||||
insert_data(change_unit.buffer_position,
|
||||
m_change_buffer->address(change_unit.change_buffer_offset),
|
||||
change_unit.length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user