Add pgup pgdown scrolling in histogram (#6535)

This commit is contained in:
Farhan Saiyed 2026-07-15 20:22:58 +05:30 committed by GitHub
parent 5349d34dcb
commit 4d7ca4161a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5220,6 +5220,7 @@ static const char *help_msg_visual_hist[] = {
"?", "", "show this help",
"hl", "", "move cursor left / right one bar",
"+/-", "", "zoom in / out",
"PgUp/PgDn", "", "jump left/right by 1/10 of the histogram width",
":cmd", "", "run a rizin command",
"q", "", "back to Visual mode (or Q / Space)",
NULL
@ -5320,6 +5321,16 @@ static RzCmdStatus print_visual_bytes(RzCore *core, RZ_OWN RZ_NONNULL RzHistogra
case 'h':
hist->barnumber = (hist->barnumber > 0) ? (hist->barnumber - 1) : (brange->nblocks - 1);
break;
case 'J': {
size_t jump = brange->nblocks / 10;
hist->barnumber = (hist->barnumber + jump) % brange->nblocks;
break;
}
case 'K': {
size_t jump = brange->nblocks / 10;
hist->barnumber = (hist->barnumber - (jump % brange->nblocks) + brange->nblocks) % brange->nblocks;
break;
}
case 'l':
hist->barnumber = (hist->barnumber == brange->nblocks - 1) ? (0) : (hist->barnumber + 1);
break;