1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:54:58 +00:00

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.
This commit is contained in:
Lennon Donaghy 2021-07-28 07:23:47 +01:00 committed by Andreas Kling
parent 4e4d8d6905
commit a071dba1ef

View file

@ -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);
}