mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
chore: remove unused function
This commit is contained in:
parent
757ad239e9
commit
49084538bc
@ -17,40 +17,6 @@ fn char_match(&self, ch: char) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn find_nth_next_tag(
|
||||
text: RopeSlice,
|
||||
tag: &str,
|
||||
mut pos: usize,
|
||||
n: usize,
|
||||
) -> Option<Vec<usize>> {
|
||||
if pos >= text.len_chars() || n == 0 {
|
||||
return None;
|
||||
}
|
||||
|
||||
let mut chars = text.chars_at(pos);
|
||||
|
||||
let tag = format!("</{tag}>");
|
||||
let len = tag.len();
|
||||
|
||||
for _ in 0..n {
|
||||
loop {
|
||||
let c = chars.next()?;
|
||||
let cloned_chars = chars.clone();
|
||||
let stri: String = cloned_chars.take(len).collect();
|
||||
|
||||
pos += 1;
|
||||
|
||||
if stri == tag {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let range: Vec<usize> = (pos - 1..pos + len - 1).collect();
|
||||
|
||||
Some(range)
|
||||
}
|
||||
|
||||
pub fn find_nth_next<M: CharMatcher>(
|
||||
text: RopeSlice,
|
||||
char_matcher: M,
|
||||
|
Loading…
Reference in New Issue
Block a user