зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-08 08:25:51 +03:00
fix tests
Этот коммит содержится в:
@@ -2006,18 +2006,19 @@ impl<'a> TextArea<'a> {
|
|||||||
/// Get the current selection start position. 0-base character-wise (row, col) selection start position.
|
/// Get the current selection start position. 0-base character-wise (row, col) selection start position.
|
||||||
/// ```
|
/// ```
|
||||||
/// use tui_textarea::TextArea;
|
/// use tui_textarea::TextArea;
|
||||||
|
/// use tui_textarea::CursorMove;
|
||||||
///
|
///
|
||||||
/// let mut textarea = TextArea::default();
|
/// let mut textarea = TextArea::from(["abc"]);
|
||||||
/// assert_eq!(textarea.selection_start(), None);
|
/// assert_eq!(textarea.selection_start(), None);
|
||||||
|
|
||||||
/// textarea.insert_char('a');
|
|
||||||
/// textarea.insert_newline();
|
|
||||||
/// textarea.insert_char('b');
|
|
||||||
///
|
///
|
||||||
/// textarea.start_selection();
|
/// textarea.start_selection();
|
||||||
/// assert_eq!(textarea.selection_start(), Some((0, 0)));
|
/// assert_eq!(textarea.selection_start(), Some((0, 0)));
|
||||||
|
///
|
||||||
/// textarea.move_cursor(CursorMove::Forward);
|
/// textarea.move_cursor(CursorMove::Forward);
|
||||||
/// assert_eq!(textarea.selection_start(), Some((0, 0)));
|
/// assert_eq!(textarea.selection_start(), Some((0, 0)));
|
||||||
|
///
|
||||||
|
/// textarea.cancel_selection();
|
||||||
|
/// assert_eq!(textarea.selection_start(), None);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn selection_start(&self) -> Option<(usize, usize)> {
|
pub fn selection_start(&self) -> Option<(usize, usize)> {
|
||||||
self.selection_start
|
self.selection_start
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user