aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/search.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src/search.rs')
-rw-r--r--helix-core/src/search.rs26
1 files changed, 3 insertions, 23 deletions
diff --git a/helix-core/src/search.rs b/helix-core/src/search.rs
index d4eb11a9..243ac227 100644
--- a/helix-core/src/search.rs
+++ b/helix-core/src/search.rs
@@ -1,12 +1,6 @@
use crate::RopeSlice;
-pub fn find_nth_next(
- text: RopeSlice,
- ch: char,
- mut pos: usize,
- n: usize,
- inclusive: bool,
-) -> Option<usize> {
+pub fn find_nth_next(text: RopeSlice, ch: char, mut pos: usize, n: usize) -> Option<usize> {
if pos >= text.len_chars() || n == 0 {
return None;
}
@@ -25,20 +19,10 @@ pub fn find_nth_next(
}
}
- if !inclusive {
- pos -= 1;
- }
-
- Some(pos)
+ Some(pos - 1)
}
-pub fn find_nth_prev(
- text: RopeSlice,
- ch: char,
- mut pos: usize,
- n: usize,
- inclusive: bool,
-) -> Option<usize> {
+pub fn find_nth_prev(text: RopeSlice, ch: char, mut pos: usize, n: usize) -> Option<usize> {
if pos == 0 || n == 0 {
return None;
}
@@ -57,9 +41,5 @@ pub fn find_nth_prev(
}
}
- if !inclusive {
- pos += 1;
- }
-
Some(pos)
}