[commands] Fix compose-while-scheduled issue and test all compositions (#5581)

This commit is contained in:
Ryan Blue
2023-12-23 15:12:13 -05:00
committed by GitHub
parent aeb1a4aa33
commit ef1cb3f41e
20 changed files with 146 additions and 83 deletions

View File

@@ -56,7 +56,8 @@ class SelectCommand : public CommandHelper<Command, SelectCommand<Key>> {
m_defaultCommand.SetComposed(true);
for (auto&& command : foo) {
CommandScheduler::GetInstance().RequireUngrouped(command.second.get());
CommandScheduler::GetInstance().RequireUngroupedAndUnscheduled(
command.second.get());
command.second.get()->SetComposed(true);
}
@@ -77,7 +78,8 @@ class SelectCommand : public CommandHelper<Command, SelectCommand<Key>> {
: m_selector{std::move(selector)} {
m_defaultCommand.SetComposed(true);
for (auto&& command : commands) {
CommandScheduler::GetInstance().RequireUngrouped(command.second.get());
CommandScheduler::GetInstance().RequireUngroupedAndUnscheduled(
command.second.get());
command.second.get()->SetComposed(true);
}