Merge pull request #3117 from mfreeborn/add-text-editor-content-is-empty

add efficient `is_empty` method to `text_editor::Content`
This commit is contained in:
Héctor 2025-11-30 19:32:19 +01:00 committed by GitHub
commit 68eb57744b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -474,6 +474,11 @@ where
pub fn cursor_position(&self) -> (usize, usize) {
self.0.borrow().editor.cursor_position()
}
/// Returns whether or not the the [`Content`] is empty.
pub fn is_empty(&self) -> bool {
self.0.borrow().editor.is_empty()
}
}
impl<Renderer> Clone for Content<Renderer>