Merge pull request #2901 from Ultrasquid9/master
Indent and Unindent Text Editor Actions
This commit is contained in:
commit
7f1dcec391
2 changed files with 16 additions and 0 deletions
|
|
@ -106,6 +106,10 @@ pub enum Edit {
|
|||
Paste(Arc<String>),
|
||||
/// Break the current line.
|
||||
Enter,
|
||||
/// Indent the current line.
|
||||
Indent,
|
||||
/// Unindent the current line.
|
||||
Unindent,
|
||||
/// Delete the previous character.
|
||||
Backspace,
|
||||
/// Delete the next character.
|
||||
|
|
|
|||
|
|
@ -377,6 +377,18 @@ impl editor::Editor for Editor {
|
|||
Edit::Paste(text) => {
|
||||
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 => {
|
||||
editor.action(
|
||||
font_system.raw(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue