diff --git a/core/src/text/editor.rs b/core/src/text/editor.rs index 6921c61c..bee5560d 100644 --- a/core/src/text/editor.rs +++ b/core/src/text/editor.rs @@ -106,6 +106,10 @@ pub enum Edit { Paste(Arc), /// Break the current line. Enter, + /// Indent the current line. + Indent, + /// Unindent the current line. + Unindent, /// Delete the previous character. Backspace, /// Delete the next character. diff --git a/graphics/src/text/editor.rs b/graphics/src/text/editor.rs index aaf46a6a..4afd7b12 100644 --- a/graphics/src/text/editor.rs +++ b/graphics/src/text/editor.rs @@ -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(),