keybinds: fixup changegroupactive
This commit is contained in:
parent
2928d6af0a
commit
f0a80ce5e0
1 changed files with 4 additions and 1 deletions
|
|
@ -1690,7 +1690,10 @@ SDispatchResult CKeybindManager::changeGroupActive(std::string args) {
|
||||||
// index starts from '1'; '0' means last window
|
// index starts from '1'; '0' means last window
|
||||||
try {
|
try {
|
||||||
const int INDEX = std::stoi(args);
|
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"}; }
|
} catch (...) { return {.success = false, .error = "invalid idx"}; }
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue