pub struct Plane { /* private fields */ }Expand description
Edited text with cursor.
Implementations§
Source§impl Plane
impl Plane
Sourcepub fn new<T: ToString>(content: T) -> Self
pub fn new<T: ToString>(content: T) -> Self
Creates a new text plane populated with the specified content.
pub fn cursor(&self) -> &Cursor
Sourcepub fn cursor_pos(&self) -> (usize, usize)
pub fn cursor_pos(&self) -> (usize, usize)
Returns the position of the cursor in text coordinates.
Cursor position is a tuple (column, row).
pub fn cursor_col(&self) -> usize
Sourcepub fn cursor_char(&self) -> Option<&Char>
pub fn cursor_char(&self) -> Option<&Char>
Returns the character pointed by the cursor.
Sourcepub fn cursor_char_above(&self) -> Option<&Char>
pub fn cursor_char_above(&self) -> Option<&Char>
Returns the character above the cursor.
Sourcepub fn cursor_move_up(&mut self) -> bool
pub fn cursor_move_up(&mut self) -> bool
Moves the cursor up in the same column.
Sourcepub fn cursor_move_down(&mut self) -> bool
pub fn cursor_move_down(&mut self) -> bool
Moves the cursor down in the same column.
Sourcepub fn cursor_move_left(&mut self) -> bool
pub fn cursor_move_left(&mut self) -> bool
Moves the cursor to the left in the same row.
Sourcepub fn cursor_move_right(&mut self) -> bool
pub fn cursor_move_right(&mut self) -> bool
Moves the cursor to the right in the same row.
Sourcepub fn cursor_move_cell_start(&mut self) -> bool
pub fn cursor_move_cell_start(&mut self) -> bool
Places the cursor at the first character of the current cell in the same row.
Sourcepub fn cursor_move_cell_end(&mut self) -> bool
pub fn cursor_move_cell_end(&mut self) -> bool
Places the cursor at the last character of the cell in the same row.
pub fn cursor_move_cell_top(&mut self) -> bool
pub fn cursor_move_cell_bottom(&mut self) -> bool
Sourcepub fn cursor_move_row_start(&mut self) -> bool
pub fn cursor_move_row_start(&mut self) -> bool
Places the cursor at the first character of the first cell in the same row.
Sourcepub fn cursor_move_row_end(&mut self) -> bool
pub fn cursor_move_row_end(&mut self) -> bool
Places the cursor at the last character of the last cell in the same row.
Sourcepub fn cursor_move_col_start(&mut self)
pub fn cursor_move_col_start(&mut self)
Places the cursor at the character of the first row in the same column.
Sourcepub fn cursor_move_col_end(&mut self)
pub fn cursor_move_col_end(&mut self)
Places the cursor at the character of the last row in the same column.
Sourcepub fn cursor_move_cell_next(&mut self) -> bool
pub fn cursor_move_cell_next(&mut self) -> bool
Places the cursor at the first character of the next cell in the same row.
Sourcepub fn cursor_move_cell_prev(&mut self) -> bool
pub fn cursor_move_cell_prev(&mut self) -> bool
Places the cursor at the last character of the previous cell in the same row.
pub fn cursor_toggle_caret_block(&mut self)
pub fn cursor_toggle_caret_under_score(&mut self)
pub fn insert_char(&mut self, ch: char) -> bool
pub fn override_char(&mut self, ch: char) -> bool
pub fn delete_char_before_cursor(&mut self) -> bool
pub fn delete_char_under_cursor(&mut self) -> bool
Sourcepub fn split_line(&mut self) -> bool
pub fn split_line(&mut self) -> bool
Splits line at cursor position.
Sourcepub fn unsplit_line(&mut self) -> bool
pub fn unsplit_line(&mut self) -> bool
Unsplits (joins) the current line with the line in a row above.