mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 18:43:30 +00:00
[CONUTILS:PAGER][MORE] Fix the default paging region.
- The column extent should cover the whole width of the console screenbuffer. On the contrary, the line extent covers only the number of lines that cover the current displayed console window. - Since the console can be resized while the pager is prompting, we need to actually recalculate in the prompt routine the default number of lines for a screen. - Reset s_nNextLineNo when paging a new file.
This commit is contained in:
parent
f74a3f6e29
commit
ff445ca184
2 changed files with 21 additions and 4 deletions
|
@ -312,7 +312,7 @@ ConWritePaging(
|
|||
if (bIsConsole)
|
||||
{
|
||||
/* Calculate the console screen extent */
|
||||
Pager->PageColumns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
||||
Pager->PageColumns = csbi.dwSize.X;
|
||||
Pager->PageRows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
||||
}
|
||||
else
|
||||
|
@ -324,14 +324,14 @@ ConWritePaging(
|
|||
|
||||
if (StartPaging)
|
||||
{
|
||||
if (bIsConsole)
|
||||
if (bIsConsole && (Pager->PageRows >= 2))
|
||||
{
|
||||
/* Reset to display one page by default */
|
||||
Pager->ScrollRows = Pager->PageRows - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* File output: all lines are displayed at once; reset to a default value */
|
||||
/* File output, or single line: all lines are displayed at once; reset to a default value */
|
||||
Pager->ScrollRows = 0;
|
||||
}
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ ConWritePaging(
|
|||
* in case the user has redimensioned it during the prompt. */
|
||||
if (bIsConsole && ConGetScreenInfo(Pager->Screen, &csbi))
|
||||
{
|
||||
Pager->PageColumns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
||||
Pager->PageColumns = csbi.dwSize.X;
|
||||
Pager->PageRows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue