summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/TextDocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI/TextDocument.cpp')
-rw-r--r--Libraries/LibGUI/TextDocument.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibGUI/TextDocument.cpp b/Libraries/LibGUI/TextDocument.cpp
index c16e757c41..10a5ffe497 100644
--- a/Libraries/LibGUI/TextDocument.cpp
+++ b/Libraries/LibGUI/TextDocument.cpp
@@ -675,6 +675,11 @@ void TextDocument::remove(const TextRange& unnormalized_range)
notify_did_change();
}
+bool TextDocument::is_empty() const
+{
+ return line_count() == 1 && line(0).is_empty();
+}
+
TextRange TextDocument::range_for_entire_line(size_t line_index) const
{
if (line_index >= line_count())