summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/text/editor.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/graphics/src/text/editor.rs b/graphics/src/text/editor.rs
index 1e375a25..1890cb82 100644
--- a/graphics/src/text/editor.rs
+++ b/graphics/src/text/editor.rs
@@ -398,6 +398,17 @@ impl editor::Editor for Editor {
editor
.action(font_system.raw(), cosmic_text::Action::Insert(c));
}
+ Action::Paste(text) => {
+ editor.insert_string(&text, None);
+
+ // TODO: Fix cosmic-text
+ // Cursor should be marked as moved after `insert_string`.
+ let cursor = editor.cursor();
+
+ editor
+ .buffer_mut()
+ .shape_until_cursor(font_system.raw(), cursor);
+ }
Action::Enter => {
editor.action(font_system.raw(), cosmic_text::Action::Enter);
}