From e9e06c8fe2ef291b04f6059a841ceb999455bea8 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 24 Jul 2024 14:52:01 +0200 Subject: Add `placeholder` support to `text_editor` widget --- core/src/text/editor.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/src/text') 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; -- cgit