Do not count undo operations in the 'would be reverted..' message (#3598)
This commit is contained in:
committed by
GitHub
parent
d46e5eca58
commit
70632b088e
11
src/TDB2.cpp
11
src/TDB2.cpp
@@ -242,7 +242,16 @@ void TDB2::revert() {
|
|||||||
bool TDB2::confirm_revert(rust::Vec<tc::Operation>& undo_ops) {
|
bool TDB2::confirm_revert(rust::Vec<tc::Operation>& undo_ops) {
|
||||||
// TODO Use show_diff rather than this basic listing of operations, though
|
// TODO Use show_diff rather than this basic listing of operations, though
|
||||||
// this might be a worthy undo.style itself.
|
// this might be a worthy undo.style itself.
|
||||||
std::cout << "The following " << undo_ops.size() << " operations would be reverted:\n";
|
|
||||||
|
// Count non-undo operations
|
||||||
|
int ops_count = 0;
|
||||||
|
for (auto& op : undo_ops) {
|
||||||
|
if (!op.is_undo_point()) {
|
||||||
|
ops_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "The following " << ops_count << " operations would be reverted:\n";
|
||||||
for (auto& op : undo_ops) {
|
for (auto& op : undo_ops) {
|
||||||
if (op.is_undo_point()) {
|
if (op.is_undo_point()) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user