keybinds: fixup changegroupactive

This commit is contained in:
Vaxry 2026-03-01 10:12:08 +00:00
parent 2928d6af0a
commit f0a80ce5e0
No known key found for this signature in database
GPG key ID: 665806380871D640

View file

@ -1690,7 +1690,10 @@ SDispatchResult CKeybindManager::changeGroupActive(std::string args) {
// index starts from '1'; '0' means last window
try {
const int INDEX = std::stoi(args);
PWINDOW->m_group->setCurrent(INDEX);
if (INDEX <= 0)
PWINDOW->m_group->setCurrent(PWINDOW->m_group->size() - 1);
else
PWINDOW->m_group->setCurrent(INDEX - 1);
} catch (...) { return {.success = false, .error = "invalid idx"}; }
return {};