fn draw_cursor(&mut self, data: &Editor) -> Result<()> {
        // Move to the correct row.
        let line = data.selection.focus.ln;
        let frame_height = self.draw_state.height;
        let relative_ln = line - self.draw_state.low;
        let up_offset = frame_height - 1 - self.draw_state.anchor.ln - relative_ln;
        // self.move_cursor_up(up_offset)?;
        self.write.queue(MoveUp(Self::usize_to_u16(up_offset)))?;

        // Move to the correct column.
        let col = data.selection.focus.col.min(data.curr_ln_len());
        let n = self.draw_state.anchor.col + col + 1;
        self.write.queue(MoveToColumn(Self::usize_to_u16(n)))?;

        self.draw_state.cursor.ln = relative_ln;
        self.draw_state.cursor.col = n;

        Ok(())
    }
// Position the cursor right after drawing a frame
// (assuming no other cursor adjustments made).
Position the cursor right after drawing a frame
(assuming no other cursor adjustments made).
Position the cursor right after drawing a frame ( assuming no other cursor adjustments made ) .
fn draw_cursor(&mut self, data: &Editor) -> Result<()> {
        // Move to the correct row.
        let line = data.selection.focus.ln;
        let frame_height = self.draw_state.height;
        let relative_ln = line - self.draw_state.low;
        let up_offset = frame_height - 1 - self.draw_state.anchor.ln - relative_ln;
        // self.move_cursor_up(up_offset)?;
        self.write.queue(MoveUp(Self::usize_to_u16(up_offset)))?;
        // Move to the correct column.
        let col = data.selection.focus.col.min(data.curr_ln_len());
        let n = self.draw_state.anchor.col + col + 1;
        self.write.queue(MoveToColumn(Self::usize_to_u16(n)))?;
        self.draw_state.cursor.ln = relative_ln;
        self.draw_state.cursor.col = n;
        Ok(())
    }
fn draw_cursor ( & mut self , data : & Editor ) -> Result < ( ) > { // Move to the correct row. let line = data . selection . focus . ln ; let frame_height = self . draw_state . height ; let relative_ln = line - self . draw_state . low ; let up_offset = frame_height - 1 - self . draw_state . anchor . ln - relative_ln ; // self.move_cursor_up(up_offset)?; self . write . queue ( MoveUp ( Self :: usize_to_u16 ( up_offset ) ) ) ? ; // Move to the correct column. let col = data . selection . focus . col . min ( data . curr_ln_len ( ) ) ; let n = self . draw_state . anchor . col + col + 1 ; self . write . queue ( MoveToColumn ( Self :: usize_to_u16 ( n ) ) ) ? ; self . draw_state . cursor . ln = relative_ln ; self . draw_state . cursor . col = n ; Ok ( ( ) ) }
Position the cursor right after drawing a frame
(assuming no other cursor adjustments made).
Position the cursor right after drawing a frame ( assuming no other cursor adjustments made ) .
&mut self
data
&Editor
&mut self
data
&Editor