diff --git a/src/core/text/edit.rs b/src/core/text/edit.rs index c412ed9..a43fd3c 100644 --- a/src/core/text/edit.rs +++ b/src/core/text/edit.rs @@ -20,6 +20,16 @@ impl TextEdit { self.align, ) } + + pub fn content(&self) -> String { + self.buf + .lines + .iter() + .map(|l| l.text()) + // why is this needed?? what?? + .collect::>() + .join("\n") + } } impl Widget for TextEdit {