summaryrefslogtreecommitdiffstats
path: root/widget/src/text_editor.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-18 19:07:41 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-18 19:07:41 +0200
commite7326f0af6f16cf2ff04fbac93bf296a044923f4 (patch)
tree05a309b7faf7a8b6f8c609c128dffa996660f1e4 /widget/src/text_editor.rs
parent8446fe6de52fa68077d23d39f728f79a29b52f00 (diff)
downloadiced-e7326f0af6f16cf2ff04fbac93bf296a044923f4.tar.gz
iced-e7326f0af6f16cf2ff04fbac93bf296a044923f4.tar.bz2
iced-e7326f0af6f16cf2ff04fbac93bf296a044923f4.zip
Flesh out the `editor` example a bit more
Diffstat (limited to 'widget/src/text_editor.rs')
-rw-r--r--widget/src/text_editor.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index 0cde2c98..970ec031 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -182,6 +182,10 @@ where
pub fn selection(&self) -> Option<String> {
self.0.borrow().editor.selection()
}
+
+ pub fn cursor_position(&self) -> (usize, usize) {
+ self.0.borrow().editor.cursor_position()
+ }
}
impl<Renderer> Default for Content<Renderer>