Indent and Unindent Text Editor Actions
This commit is contained in:
parent
f67785edb5
commit
0b6e0667ae
2 changed files with 16 additions and 0 deletions
|
|
@ -106,6 +106,10 @@ pub enum Edit {
|
||||||
Paste(Arc<String>),
|
Paste(Arc<String>),
|
||||||
/// Break the current line.
|
/// Break the current line.
|
||||||
Enter,
|
Enter,
|
||||||
|
/// Indent the current line.
|
||||||
|
Indent,
|
||||||
|
/// Unindent the current line.
|
||||||
|
Unindent,
|
||||||
/// Delete the previous character.
|
/// Delete the previous character.
|
||||||
Backspace,
|
Backspace,
|
||||||
/// Delete the next character.
|
/// Delete the next character.
|
||||||
|
|
|
||||||
|
|
@ -377,6 +377,18 @@ impl editor::Editor for Editor {
|
||||||
Edit::Paste(text) => {
|
Edit::Paste(text) => {
|
||||||
editor.insert_string(&text, None);
|
editor.insert_string(&text, None);
|
||||||
}
|
}
|
||||||
|
Edit::Indent => {
|
||||||
|
editor.action(
|
||||||
|
font_system.raw(),
|
||||||
|
cosmic_text::Action::Indent,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Edit::Unindent => {
|
||||||
|
editor.action(
|
||||||
|
font_system.raw(),
|
||||||
|
cosmic_text::Action::Unindent,
|
||||||
|
);
|
||||||
|
}
|
||||||
Edit::Enter => {
|
Edit::Enter => {
|
||||||
editor.action(
|
editor.action(
|
||||||
font_system.raw(),
|
font_system.raw(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue