diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-05-06 17:50:54 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-06 23:00:43 +0100 |
commit | 228c1f496853da8869a20c9e387cc5ed65bb2be1 (patch) | |
tree | f7f13bcc3813dfd0c65376532a1a2c25f055d8b0 /Userland/Libraries/LibGUI/TextDocument.cpp | |
parent | fb6d236ba2511f2f4a8b31adf844951215f50aeb (diff) | |
download | serenity-228c1f496853da8869a20c9e387cc5ed65bb2be1.zip |
LibGUI: Remove line-is-empty check in TextDocument return-early
This patch removes an incorrect way for TextDocument::text_in_range
to return early when the first line of the selection was empty. This
fixes an issue in TextEditor where the status bar showed that 0
characters are selected when the selection started on an empty line.
Diffstat (limited to 'Userland/Libraries/LibGUI/TextDocument.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/TextDocument.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp index f42cfa4624..e007ce65cc 100644 --- a/Userland/Libraries/LibGUI/TextDocument.cpp +++ b/Userland/Libraries/LibGUI/TextDocument.cpp @@ -343,7 +343,7 @@ String TextDocument::text() const String TextDocument::text_in_range(const TextRange& a_range) const { auto range = a_range.normalized(); - if (is_empty() || line_count() < range.end().line() - range.start().line() || line(range.start().line()).is_empty()) + if (is_empty() || line_count() < range.end().line() - range.start().line()) return String(""); StringBuilder builder; |