summaryrefslogtreecommitdiffstats
path: root/core/src/text
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-16 15:40:16 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-16 15:40:16 +0200
commitd051f21597bb333ac10183aaa3214a292e9aa365 (patch)
tree0735e31bae1fefcf004ebba199bd5ec759040605 /core/src/text
parentc6d0443627c22dcf1576303e5a426aa3622f1b7d (diff)
downloadiced-d051f21597bb333ac10183aaa3214a292e9aa365.tar.gz
iced-d051f21597bb333ac10183aaa3214a292e9aa365.tar.bz2
iced-d051f21597bb333ac10183aaa3214a292e9aa365.zip
Implement `Copy` and `Paste` actions for `text::Editor`
Diffstat (limited to 'core/src/text')
-rw-r--r--core/src/text/editor.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/text/editor.rs b/core/src/text/editor.rs
index 5532fac5..003557c1 100644
--- a/core/src/text/editor.rs
+++ b/core/src/text/editor.rs
@@ -1,6 +1,8 @@
use crate::text::LineHeight;
use crate::{Pixels, Point, Rectangle, Size};
+use std::sync::Arc;
+
pub trait Editor: Sized + Default {
type Font: Copy + PartialEq + Default;
@@ -30,13 +32,14 @@ pub trait Editor: Sized + Default {
);
}
-#[derive(Debug, Clone, Copy, PartialEq)]
+#[derive(Debug, Clone, PartialEq)]
pub enum Action {
Move(Motion),
Select(Motion),
SelectWord,
SelectLine,
Insert(char),
+ Paste(Arc<String>),
Enter,
Backspace,
Delete,