/// Advance a grid iterator over fullwidth characters.
Advance a grid iterator over fullwidth characters.
Advance a grid iterator over fullwidth characters .
fn skip_fullwidth<'a>(
        &self,
        iter: &'a mut GridIterator<'_, Cell>,
        cell: &mut &'a Cell,
        direction: Direction,
    ) {
        match direction {
            Direction::Right if cell.flags.contains(Flags::WIDE_CHAR) => {
                iter.next();
            },
            Direction::Right if cell.flags.contains(Flags::LEADING_WIDE_CHAR_SPACER) => {
                if let Some(new_cell) = iter.next() {
                    *cell = new_cell;
                }
                iter.next();
            },
            Direction::Left if cell.flags.contains(Flags::WIDE_CHAR_SPACER) => {
                if let Some(new_cell) = iter.prev() {
                    *cell = new_cell;
                }
                let prev = iter.point().sub_absolute(self, Boundary::Clamp, 1);
                if self.grid[prev].flags.contains(Flags::LEADING_WIDE_CHAR_SPACER) {
                    iter.prev();
                }
            },
            _ => (),
        }
    }
fn skip_fullwidth < ' a > ( & self , iter : & ' a mut GridIterator < ' _ , Cell > , cell : & mut & ' a Cell , direction : Direction , ) { match direction { Direction :: Right if cell . flags . contains ( Flags :: WIDE_CHAR ) => { iter . next ( ) ; } , Direction :: Right if cell . flags . contains ( Flags :: LEADING_WIDE_CHAR_SPACER ) => { if let Some ( new_cell ) = iter . next ( ) { * cell = new_cell ; } iter . next ( ) ; } , Direction :: Left if cell . flags . contains ( Flags :: WIDE_CHAR_SPACER ) => { if let Some ( new_cell ) = iter . prev ( ) { * cell = new_cell ; } let prev = iter . point ( ) . sub_absolute ( self , Boundary :: Clamp , 1 ) ; if self . grid [ prev ] . flags . contains ( Flags :: LEADING_WIDE_CHAR_SPACER ) { iter . prev ( ) ; } } , _ => ( ) , } }
Advance a grid iterator over fullwidth characters.
Advance a grid iterator over fullwidth characters .
&self
iter
&'a mut GridIterator<'_, Cell>
cell
&mut &'a Cell
direction
Direction