Lines Matching refs:cursor
20 pub cursor: usize, field
32 cursor: 0, in new()
41 self.cursor = 0; in init_before_readline()
52 let len_to_end = self.buf.deref().borrow().len() - self.cursor; in insert()
56 buf.splice(self.cursor..self.cursor, bytes.iter().cloned()); in insert()
61 String::from_utf8(buf[self.cursor..].to_vec()).unwrap() in insert()
68 crossterm::cursor::MoveLeft(len_to_end.try_into().unwrap()) in insert()
72 self.cursor += bytes.len(); in insert()
79 let cursor = self.cursor; in delete() localVariable
83 if cursor + len - 1 < buf_len { in delete()
85 self.buf.deref().borrow_mut().drain(cursor..cursor + len); in delete()
90 String::from_utf8(self.buf.deref().borrow()[self.cursor..].to_vec()).unwrap() in delete()
99 crossterm::cursor::MoveLeft((buf_len - cursor).try_into().unwrap()) in delete()
107 if self.cursor > 0 { in backspace()
114 if self.cursor > 0 { in cursor_left()
117 crossterm::cursor::MoveLeft(len.try_into().unwrap()) in cursor_left()
120 self.cursor -= len; in cursor_left()
126 if self.cursor < buf.len() { in cursor_right()
129 crossterm::cursor::MoveRight(len.try_into().unwrap()) in cursor_right()
132 self.cursor += len; in cursor_right()
137 self.cursor_left(self.cursor); in home()
142 self.cursor_right(buf_len - self.cursor); in end()
164 crossterm::cursor::MoveLeft(remain_len.try_into().unwrap()) in change_line()
169 self.cursor = new_buf_len; in change_line()