| 470 | } |
| 471 | |
| 472 | std::string Workspaces::getCycleWorkspace(std::vector<Json::Value>::iterator it, bool prev) const { |
| 473 | if (prev && it == workspaces_.begin() && !config_["disable-scroll-wraparound"].asBool()) { |
| 474 | return (*(--workspaces_.end()))["name"].asString(); |
| 475 | } |
| 476 | if (prev && it != workspaces_.begin()) |
| 477 | --it; |
| 478 | else if (!prev && it != workspaces_.end()) |
| 479 | ++it; |
| 480 | if (!prev && it == workspaces_.end()) { |
| 481 | if (config_["disable-scroll-wraparound"].asBool()) { |
| 482 | --it; |
| 483 | } else { |
| 484 | return (*(workspaces_.begin()))["name"].asString(); |
| 485 | } |
| 486 | } |
| 487 | return (*it)["name"].asString(); |
| 488 | } |
| 489 | |
| 490 | std::string Workspaces::trimWorkspaceName(std::string name) { |
| 491 | std::size_t found = name.find(':'); |