pub struct View {
pub next_bytes: Vec<u8>,
pub prev_screen_time: Instant,
pub review_cursor_position: (u16, u16),
/* private fields */
}
Fields§
§next_bytes: Vec<u8>
§prev_screen_time: Instant
§review_cursor_position: (u16, u16)
Implementations§
Source§impl View
impl View
pub fn new(rows: u16, cols: u16) -> Self
Sourcepub fn process_changes(&mut self, buf: &[u8])
pub fn process_changes(&mut self, buf: &[u8])
Processes new changes, updating the internal screen representation
Sourcepub fn finalize_changes(&mut self)
pub fn finalize_changes(&mut self)
Advances the previous screen to match the current one, and sets its update time to now
Sourcepub fn prev_screen(&self) -> &Screen
pub fn prev_screen(&self) -> &Screen
Gets the previous screen backing this view
Sourcepub fn review_cursor_indentation_level(&mut self) -> (u16, bool)
pub fn review_cursor_indentation_level(&mut self) -> (u16, bool)
Gets the indentation level of the line under the review cursor, and whether it’s changed since the last time this method was called.
Sourcepub fn application_cursor_indentation_level(&mut self) -> (u16, bool)
pub fn application_cursor_indentation_level(&mut self) -> (u16, bool)
Gets the indentation level of the line under the application cursor, and whether it’s changed since the last time this method was called.
Sourcepub fn review_cursor_up(&mut self, skip_blank_lines: bool) -> bool
pub fn review_cursor_up(&mut self, skip_blank_lines: bool) -> bool
Moves the review cursor up a line. If skip_blank_lines is true, the review cursor will move up to the previous non blank line, or remain in place if this is the first non blank line. This method will return true only if the cursor moved.
Sourcepub fn review_cursor_down(&mut self, skip_blank_lines: bool) -> bool
pub fn review_cursor_down(&mut self, skip_blank_lines: bool) -> bool
Moves the review cursor down a line. If skip_blank_lines is true, the review cursor will move down to the next non blank line, or remain in place if this is the last non blank line. This method will return true only if the cursor moved.
Sourcepub fn review_cursor_prev_word(&mut self) -> bool
pub fn review_cursor_prev_word(&mut self) -> bool
Moves the cursor to the start of the previous word, or the beginning of the line if the cursor is in or before the first word. This method will return true only if the cursor moved to a different word.
Sourcepub fn review_cursor_next_word(&mut self) -> bool
pub fn review_cursor_next_word(&mut self) -> bool
Moves the cursor to the start of the next word, or the end of the line if the cursor is in or past the last word. This method will return true only if the cursor moved to a different word.
Sourcepub fn review_cursor_left(&mut self) -> bool
pub fn review_cursor_left(&mut self) -> bool
Moves the review cursor left a column. If the next cell continues a wide character, it will be skipped. This method will return true only if the cursor moved.
Sourcepub fn review_cursor_right(&mut self) -> bool
pub fn review_cursor_right(&mut self) -> bool
Moves the review cursor right a column. If the next cell continues a wide character, it will be skipped. This method will return true only if the cursor moved.