mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
add page up/down and home/end support to less
This commit is contained in:
parent
af70e329da
commit
e8ef43130a
1 changed files with 24 additions and 0 deletions
|
|
@ -388,6 +388,30 @@ Options:
|
|||
showAt(topLine);
|
||||
}
|
||||
break;
|
||||
case 'PageUp':
|
||||
if (topLine > 0) {
|
||||
topLine -= tty.lines-1;
|
||||
if (topLine < 0)
|
||||
topLine = 0;
|
||||
showAt(topLine);
|
||||
}
|
||||
break;
|
||||
case 'PageDown':
|
||||
if (topLine < bottomLine) {
|
||||
topLine += tty.lines-1;
|
||||
if (topLine >= bottomLine)
|
||||
topLine = bottomLine;
|
||||
showAt(topLine);
|
||||
}
|
||||
break;
|
||||
case 'Home':
|
||||
topLine = 0;
|
||||
showAt(topLine);
|
||||
break;
|
||||
case 'End':
|
||||
topLine = bottomLine;
|
||||
showAt(topLine);
|
||||
break;
|
||||
}
|
||||
});
|
||||
tty.draw('Loading...');
|
||||
|
|
|
|||
Loading…
Reference in a new issue