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.
This commit is contained in:
Alexey Yerin 2021-02-10 11:31:27 +03:00 committed by Isaac Freund
parent aeeae92611
commit 945b7dc986

View file

@ -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,
);