Selaa lähdekoodia

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.
Max Wipfli 4 vuotta sitten
vanhempi
commit
228c1f4968
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      Userland/Libraries/LibGUI/TextDocument.cpp

+ 1 - 1
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;