1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 14:26:17 +03:00
Этот коммит содержится в:
rhysd
2022-06-14 16:48:54 +09:00
родитель 32c31c7b9b
Коммит c1598c5600

Просмотреть файл

@@ -1071,6 +1071,20 @@ impl<'a> TextArea<'a> {
pub fn cursor(&self) -> (usize, usize) {
self.cursor
}
/// Check if the textarea has a empty content.
/// ```
/// use tui_textarea::TextArea;
///
/// let textarea = TextArea::default();
/// assert!(textarea.is_empty());
///
/// let textarea = TextArea::from(["hello"]);
/// assert!(!textarea.is_empty());
/// ```
pub fn is_empty(&self) -> bool {
self.lines == [""]
}
}
struct Renderer<'a> {