()
| 3699 | return this.windows.find((window) => window.id === windowId); |
| 3700 | } |
| 3701 | |
| 3702 | public isActiveWindowId(windowId: string): boolean { |
| 3703 | return this.activeWindowId === windowId; |
| 3704 | } |
| 3705 | |
| 3706 | public moveFocusedTile(direction: -1 | 1): boolean { |
| 3707 | if (!this.isTiled) { |
| 3708 | return false; |
| 3709 | } |
| 3710 | |
| 3711 | const focused = this.focusedWindow(); |
| 3712 | if (!focused || !this.shouldTile(focused)) { |
| 3713 | return false; |
| 3714 | } |
| 3715 | |
| 3716 | const tileable = this.tileableWindows(); |
| 3717 | const currentIndex = tileable.findIndex( |
| 3718 | (window) => window.id === focused.id, |
| 3719 | ); |
| 3720 | if (currentIndex < 0) { |
| 3721 | return false; |
| 3722 | } |
| 3723 | |
| 3724 | const nextIndex = currentIndex + direction; |
| 3725 | if (nextIndex < 0 || nextIndex >= tileable.length) { |
| 3726 | return false; |
| 3727 | } |
no test coverage detected