/// Get n'th next ocurrence of a given charecter (relatively to the cursor)
Get n'th next ocurrence of a given charecter (relatively to the cursor)
Get n ' th next ocurrence of a given charecter ( relatively to the cursor )
pub fn next_ocur(&self, c: char, n: usize) -> Option<usize> {
        let mut dn = 0;
        let mut x = self.x();
        for (i, ch) in self.buffers.current_buffer()[self.y()]
            .chars()
            .skip(x)
            .enumerate()
        {
            if ch == c {
                if i > 0 {
                    dn += 1;
                    if dn == n {
                        x += i;
                        return Some(x);
                    }
                }
            }
        }
        None
    }
pub fn next_ocur ( & self , c : char , n : usize ) -> Option < usize > { let mut dn = 0 ; let mut x = self . x ( ) ; for ( i , ch ) in self . buffers . current_buffer ( ) [ self . y ( ) ] . chars ( ) . skip ( x ) . enumerate ( ) { if ch == c { if i > 0 { dn += 1 ; if dn == n { x += i ; return Some ( x ) ; } } } } None }
Get n'th next ocurrence of a given charecter (relatively to the cursor)
Get n ' th next ocurrence of a given charecter ( relatively to the cursor )
&self
c
char
n
usize