pub fn calc_char_pos_at(&self, byte_pos: usize) -> usize {
        let mut pos = 1;
        for (idx, _) in self.text.char_indices() {
            if idx >= byte_pos {
                break;
            }

            pos += 1;
        }

        pos
    }
/// Calculates the current position in chars.
Calculates the current position in chars.
Calculates the current position in chars .
pub fn calc_char_pos_at(&self, byte_pos: usize) -> usize {
        let mut pos = 1;
        for (idx, _) in self.text.char_indices() {
            if idx >= byte_pos {
                break;
            }
            pos += 1;
        }
        pos
    }
pub fn calc_char_pos_at ( & self , byte_pos : usize ) -> usize { let mut pos = 1 ; for ( idx , _ ) in self . text . char_indices ( ) { if idx >= byte_pos { break ; } pos += 1 ; } pos }
Calculates the current position in chars.
Calculates the current position in chars .
&self
byte_pos
usize