From a071dba1ef63be126db9874958b01eacbfe77f82 Mon Sep 17 00:00:00 2001 From: Lennon Donaghy Date: Wed, 28 Jul 2021 07:23:47 +0100 Subject: [PATCH] Utilities: Add fix for 'less' not buffering the correct number of lines 'down_n()' now correctly buffers the needed number of lines, previously there were issues with using it to scroll much more than the existing buffer. --- Userland/Utilities/less.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Userland/Utilities/less.cpp b/Userland/Utilities/less.cpp index 7c1d6a74ac..9daecc46f0 100644 --- a/Userland/Utilities/less.cpp +++ b/Userland/Utilities/less.cpp @@ -141,7 +141,7 @@ public: { clear_status(); - while (n - (m_lines.size() - m_line) > 0) { + while (n - (m_lines.size() - m_line) + m_height - 1 > 0) { if (!read_line()) break; } @@ -158,8 +158,6 @@ public: void bottom() { - while (read_line()) - ; down_n(m_lines.size() - m_line); }