From 693f2f74cdcf99207d6439a8f5c39c8f5514cffb Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 3 Apr 2021 17:44:48 -0400 Subject: [PATCH] CmdEdit: Respect bulk option Since 'task edit' is a data-modification operation (that is particularly hard to cancel mid-way), it should also respect the 'bulk' option like all the other modification operations (mod, start...). Closes #2428. --- src/commands/CmdEdit.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 9cad69b69..589727b53 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -88,6 +88,14 @@ int CmdEdit::execute (std::string&) return 1; } + unsigned int bulk = Context::getContext ().config.getInteger ("bulk"); + + // If we are editing more than "bulk" tasks, ask for confirmation. + // Bulk = 0 denotes infinite bulk. + if ((filtered.size () > bulk) && (bulk != 0)) + if (! confirm (format ("Do you wish to manually edit {1} tasks?", filtered.size ()))) + return 2; + // Find number of matching tasks. for (auto& task : filtered) {