Skip to content

Commit

Permalink
Do not count undo operations in the 'would be reverted..' message (Go…
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche authored Aug 14, 2024
1 parent d46e5ec commit 70632b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/TDB2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,16 @@ void TDB2::revert() {
bool TDB2::confirm_revert(rust::Vec<tc::Operation>& undo_ops) {
// TODO Use show_diff rather than this basic listing of operations, though
// 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) {
if (op.is_undo_point()) {
continue;
Expand Down

0 comments on commit 70632b0

Please sign in to comment.