bug fix: when applying change operations in reverse, apply their change units in reverse order
This commit is contained in:
parent
0cd38f2198
commit
2e2cdfdb81
@ -387,10 +387,22 @@ void Buffer::save_current_operation()
|
||||
|
||||
void Buffer::apply_change_operation(const ChangeOperation & change_operation, bool forward)
|
||||
{
|
||||
if (forward)
|
||||
{
|
||||
for (auto change_unit : change_operation.changes)
|
||||
{
|
||||
apply_change_unit(change_unit, forward);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto i = change_operation.changes.rbegin();
|
||||
i != change_operation.changes.rend();
|
||||
i++)
|
||||
{
|
||||
apply_change_unit(*i, forward);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Buffer::apply_change_unit(const ChangeUnit & change_unit, bool forward)
|
||||
|
Loading…
x
Reference in New Issue
Block a user