1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-08-28 11:36:17 +03:00

implement TextArea::select_all

but it is not assigned to default key shortcuts because C-a is already
in use.
Этот коммит содержится в:
rhysd
2023-11-15 00:11:18 +09:00
родитель 9d03463237
Коммит 523a888f26
3 изменённых файлов: 33 добавлений и 0 удалений

Просмотреть файл

@@ -1420,6 +1420,18 @@ fn test_set_yank_paste_text() {
}
}
#[test]
fn test_select_all() {
let mut t = TextArea::from(["aaa", "bbb", "ccc"]);
t.select_all();
assert!(t.is_selecting());
assert_eq!(t.cursor(), (2, 3));
t.cut();
assert_eq!(t.lines(), [""]);
assert_eq!(t.yank_text(), "aaa\nbbb\nccc");
assert_undo_redo((2, 3), &["aaa", "bbb", "ccc"], &[""], &mut t, "");
}
struct DeleteTester(&'static [&'static str], fn(&mut TextArea) -> bool);
impl DeleteTester {
fn test(&self, before: (usize, usize), after: (usize, usize, &[&str], &str)) {