From 493cc97a76fc7cfaf1124e8514e230476d9c9795 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sun, 1 Oct 2023 15:37:08 +0800 Subject: [PATCH] .. [no ci] --- core/src/manager/finder.rs | 4 ++-- core/src/manager/tab.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/manager/finder.rs b/core/src/manager/finder.rs index b8fdec8e..0544e139 100644 --- a/core/src/manager/finder.rs +++ b/core/src/manager/finder.rs @@ -18,7 +18,7 @@ impl Finder { } pub(super) fn prev(&self, files: &Files, cursor: usize, include: bool) -> Option { - for i in include as usize ^ 1..files.len() { + for i in !include as usize..files.len() { let idx = (cursor + files.len() - i) % files.len(); if files[idx].name().is_some_and(|n| self.matches(n)) { return Some(idx as isize - cursor as isize); @@ -28,7 +28,7 @@ impl Finder { } pub(super) fn next(&self, files: &Files, cursor: usize, include: bool) -> Option { - for i in include as usize ^ 1..files.len() { + for i in !include as usize..files.len() { let idx = (cursor + i) % files.len(); if files[idx].name().is_some_and(|n| self.matches(n)) { return Some(idx as isize - cursor as isize); diff --git a/core/src/manager/tab.rs b/core/src/manager/tab.rs index 7506314f..a8a28ceb 100644 --- a/core/src/manager/tab.rs +++ b/core/src/manager/tab.rs @@ -287,7 +287,7 @@ impl Tab { finder.next(&self.current.files, self.current.cursor(), false) }; - b || step.is_some_and(|s| self.arrow(s.into())) + b | step.is_some_and(|s| self.arrow(s.into())) } pub fn search(&mut self, grep: bool) -> bool {