Support tab for indent/un-indent
This commit is contained in:
parent
621e9d75eb
commit
f6abeb32e4
2 changed files with 26 additions and 18 deletions
|
|
@ -405,6 +405,14 @@ where
|
|||
editor.action(Action::Delete);
|
||||
status = Status::Captured;
|
||||
}
|
||||
KeyCode::Tab => {
|
||||
if modifiers.shift() {
|
||||
editor.action(Action::Unindent);
|
||||
} else {
|
||||
editor.action(Action::Indent);
|
||||
}
|
||||
status = Status::Captured;
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
|
||||
|
|
@ -414,7 +422,7 @@ where
|
|||
// Only parse keys when Super, Ctrl, and Alt are not pressed
|
||||
if !state.modifiers.logo() && !state.modifiers.control() && !state.modifiers.alt() {
|
||||
match character {
|
||||
'\n' | '\r' => {}
|
||||
'\n' | '\r' | '\t' => {}
|
||||
_ => {
|
||||
editor.action(Action::Insert(character));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue