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,9 +387,21 @@ void Buffer::save_current_operation()
|
|||||||
|
|
||||||
void Buffer::apply_change_operation(const ChangeOperation & change_operation, bool forward)
|
void Buffer::apply_change_operation(const ChangeOperation & change_operation, bool forward)
|
||||||
{
|
{
|
||||||
for (auto change_unit : change_operation.changes)
|
if (forward)
|
||||||
{
|
{
|
||||||
apply_change_unit(change_unit, 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user