From 87ebcff525a540cc4fffc5f030878b7b8d98f40f Mon Sep 17 00:00:00 2001 From: paxcut <53811119+paxcut@users.noreply.github.com> Date: Mon, 29 Dec 2025 12:01:26 -0700 Subject: [PATCH] fix: Unable to delete empty lines in text editor (#2588) fixes for issue #2587 (cherry picked from commit b835c48a0c07c426c955552edac35520d1398e8c) --- plugins/ui/source/ui/text_editor/support.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/ui/source/ui/text_editor/support.cpp b/plugins/ui/source/ui/text_editor/support.cpp index 7f5f188c3..cc0c4c9c0 100644 --- a/plugins/ui/source/ui/text_editor/support.cpp +++ b/plugins/ui/source/ui/text_editor/support.cpp @@ -505,10 +505,12 @@ namespace hex::ui { bool TextEditor::isEmpty() const { auto size = m_lines.size(); - for (u32 i = 0; i < size; ++i) { - if (!m_lines[i].empty()) - return false; - } + if (size > 1) + return false; + if (size == 0) + return true; + if (m_lines[0].empty()) + return true; return true; }