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:
commit
68eb57744b
1 changed files with 5 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue