1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

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.
This commit is contained in:
Max Wipfli 2021-05-06 17:50:54 +02:00 committed by Linus Groh
parent fb6d236ba2
commit 228c1f4968

View file

@ -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;