bug fix: when applying change operations in reverse, apply their change units in reverse order
This commit is contained in:
1 parent
0cd38f2198
commit
2e2cdfdb81
1 file changed
+14
-2
+14
-2
@@ -387,9 +387,21 @@ void Buffer::save_current_operation()
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user