From 70632b088e94a6babe21526ecde22044fbfc16ca Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Wed, 14 Aug 2024 08:35:34 -0400 Subject: [PATCH] Do not count undo operations in the 'would be reverted..' message (#3598) --- src/TDB2.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 30009b42c..5b93ad4ac 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -242,7 +242,16 @@ void TDB2::revert() { bool TDB2::confirm_revert(rust::Vec& 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;