зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-03 14:26:17 +03:00
handle Key::Char('\n' | '\r') as Key::Enter
Этот коммит содержится в:
@@ -174,6 +174,22 @@ impl<'a> TextArea<'a> {
|
||||
pub fn input(&mut self, input: impl Into<Input>) -> bool {
|
||||
let input = input.into();
|
||||
let modified = match input {
|
||||
Input {
|
||||
key: Key::Char('m'),
|
||||
ctrl: true,
|
||||
alt: false,
|
||||
}
|
||||
| Input {
|
||||
key: Key::Char('\n' | '\r'),
|
||||
ctrl: false,
|
||||
alt: false,
|
||||
}
|
||||
| Input {
|
||||
key: Key::Enter, ..
|
||||
} => {
|
||||
self.insert_newline();
|
||||
true
|
||||
}
|
||||
Input {
|
||||
key: Key::Char(c),
|
||||
ctrl: false,
|
||||
@@ -207,17 +223,6 @@ impl<'a> TextArea<'a> {
|
||||
ctrl: false,
|
||||
alt: false,
|
||||
} => self.delete_next_char(),
|
||||
Input {
|
||||
key: Key::Char('m'),
|
||||
ctrl: true,
|
||||
alt: false,
|
||||
}
|
||||
| Input {
|
||||
key: Key::Enter, ..
|
||||
} => {
|
||||
self.insert_newline();
|
||||
true
|
||||
}
|
||||
Input {
|
||||
key: Key::Char('k'),
|
||||
ctrl: true,
|
||||
|
||||
Ссылка в новой задаче
Block a user