summaryrefslogtreecommitdiffstats
path: root/core/src/text
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/text')
-rw-r--r--core/src/text/editor.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/text/editor.rs b/core/src/text/editor.rs
index aea00921..135707d1 100644
--- a/core/src/text/editor.rs
+++ b/core/src/text/editor.rs
@@ -13,6 +13,9 @@ pub trait Editor: Sized + Default {
/// Creates a new [`Editor`] laid out with the given text.
fn with_text(text: &str) -> Self;
+ /// Returns true if the [`Editor`] has no contents.
+ fn is_empty(&self) -> bool;
+
/// Returns the current [`Cursor`] of the [`Editor`].
fn cursor(&self) -> Cursor;