From 945b7dc9861f6c90d79d1faf5c97adc1da684253 Mon Sep 17 00:00:00 2001 From: Alexey Yerin Date: Wed, 10 Feb 2021 11:31:27 +0300 Subject: [PATCH] swap: use correct direction for it_wrap Always using .forward results in a crash when running `swap previous` on the first view in stack which should be wrapped. --- river/command/swap.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/river/command/swap.zig b/river/command/swap.zig index ac2f1a8..2c138fe 100644 --- a/river/command/swap.zig +++ b/river/command/swap.zig @@ -51,7 +51,7 @@ pub fn swap( ); var it_wrap = ViewStack(View).iter( if (direction == .next) output.views.first else output.views.last, - .forward, + if (direction == .next) .forward else .reverse, output.pending.tags, filter, );