1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-07 16:05:50 +03:00

return if text was modified or not from methods to edit text

Этот коммит содержится в:
rhysd
2022-06-15 20:15:28 +09:00
родитель 6ebd099f28
Коммит b7facac135
4 изменённых файлов: 180 добавлений и 88 удалений

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

@@ -274,7 +274,9 @@ loop {
match Input::from(read()?) {
Input { key: Key::Char('m'), ctrl: true, alt: false }
| Input { key: Key::Enter, .. } => continue,
input => textarea.input(key),
input => {
textarea.input(key);
}
}
}
@@ -347,8 +349,12 @@ loop {
_ => {},
},
Mode::Insert => match Input::from(read()?) {
Input { key: Key::Esc, .. } => mode = Mode::Normal,
input => textarea.input(input), // Use default key mappings in insert mode
Input { key: Key::Esc, .. } => {
mode = Mode::Normal;
}
input => {
textarea.input(input); // Use default key mappings in insert mode
}
},
}
}