feat: swiping won't wrap-around to other rows (closes #3983)

This commit is contained in:
lwouis committed 2024-12-24 02:17:58 +01:00
1 parent 9adf64c374
commit 6215b65ec9
1 file changed
+5 -2
+5 -2
View File
@@ -181,8 +181,11 @@ class Windows {
static func cycleFocusedWindowIndex(_ step: Int, allowWrap: Bool = true) {
let nextIndex = windowIndexAfterCycling(step)
if ((step > 0 && nextIndex < focusedWindowIndex) || (step < 0 && nextIndex > focusedWindowIndex)) &&
(!allowWrap || ATShortcut.lastEventIsARepeat || KeyRepeatTimer.timer?.isValid ?? false) {
// don't wrap-around at the end, if key-repeat
if (((step > 0 && nextIndex < focusedWindowIndex) || (step < 0 && nextIndex > focusedWindowIndex)) &&
(ATShortcut.lastEventIsARepeat || KeyRepeatTimer.timer?.isValid ?? false))
// don't cycle to another row, if !allowWrap
|| (!allowWrap && list[nextIndex].rowIndex != list[focusedWindowIndex].rowIndex) {
return
}
updateFocusedAndHoveredWindowIndex(nextIndex)