]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
more: fix ARROW_DOWN and PAGE_DOWN behaviour to not skip lines
authorHannes Müller <>
Wed, 17 Mar 2021 19:42:11 +0000 (20:42 +0100)
committerHannes Müller <>
Wed, 17 Mar 2021 19:42:11 +0000 (20:42 +0100)
Currently ARROW_DOWN and PAGE_DOWN is bound to command 's' (skip lines).
But this behaviour is not what the user expects, since at least one line
is always missing! Furthermore at the end of the file there is typically
this skipping lines message, if the remainder does not fit in a
complete screen. This conflicts also with e.g. less and man PAGE_DOWN
behaviour. The 'natural' behaviour is binding to
more_kc_jump_lines_per_screen.
If more is extended to also jump only a specific number of lines forward,
this would be even a better binding for ARROW_DOWN.

text-utils/more.c

index bc3d526e048413126426283680a22897ed87267f..b61b37a86466a5cfa6d4b208ea48e9cb941fbd12 100644 (file)
@@ -815,13 +815,13 @@ static struct number_command read_command(struct more_control *ctl)
                        cmd.key = more_kc_backwards;
                        return cmd;
                } else if (!memcmp(input, ARROW_DOWN, sizeof(ARROW_DOWN))) {
-                       cmd.key = more_kc_skip_forward_line;
+                       cmd.key = more_kc_jump_lines_per_screen;
                        return cmd;
                } else if (!memcmp(input, PAGE_UP, sizeof(PAGE_UP))) {
                        cmd.key = more_kc_backwards;
                        return cmd;
                } else if (!memcmp(input, PAGE_DOWN, sizeof(PAGE_DOWN))) {
-                       cmd.key = more_kc_skip_forward_line;
+                       cmd.key = more_kc_jump_lines_per_screen;
                        return cmd;
                }
        }