From f84b2e9e7d910e25efaa9969fc1408c0f46d2348 Mon Sep 17 00:00:00 2001 From: Matteo Benetti Date: Thu, 10 Nov 2022 21:13:52 +0100 Subject: [PATCH] LibLine: Fix save line condition Fix condition used by actual_rendered_string_length_step() to check if the line reached the desired length. --- Userland/Libraries/LibLine/Editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index de1f80f290..5a5b61bfd6 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -1909,7 +1909,7 @@ VTState actual_rendered_string_length_step(StringMetrics& metrics, size_t index, }; // FIXME: current_line.visible_length can go above maximum_line_width when using masks - if (maximum_line_width.has_value() && maximum_line_width.value() >= current_line.visible_length) + if (maximum_line_width.has_value() && current_line.visible_length >= maximum_line_width.value()) save_line(); ScopeGuard bit_length_update { [&last_return, ¤t_line, &index]() {