From b835c48a0c07c426c955552edac35520d1398e8c 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 --- 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 e3c28ef52..afef55e54 100644 --- a/plugins/ui/source/ui/text_editor/support.cpp +++ b/plugins/ui/source/ui/text_editor/support.cpp @@ -510,10 +510,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; }