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.
This commit is contained in:
Tomas Babej 2021-04-03 17:44:48 -04:00
parent d95b64c5a0
commit 693f2f74cd

View file

@ -88,6 +88,14 @@ int CmdEdit::execute (std::string&)
return 1; 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. // Find number of matching tasks.
for (auto& task : filtered) for (auto& task : filtered)
{ {