From e52003049c5cf2ea7285b66aab5dcdf5b2498d69 Mon Sep 17 00:00:00 2001 From: Delapouite Date: Sun, 17 Sep 2017 19:55:06 +0200 Subject: [PATCH] Add count support for scroll keys (PageUp, PageDown, C-bfud) --- src/normal.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index c7b37811..2a4639d3 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1222,10 +1222,11 @@ void select_object(Context& context, NormalParams params) } template -void scroll(Context& context, NormalParams) +void scroll(Context& context, NormalParams params) { Window& window = context.window(); - const LineCount offset = (window.dimensions().line - 2) / (half ? 2 : 1); + const int count = params.count ? params.count : 1; + const LineCount offset = (window.dimensions().line - 2) / (half ? 2 : 1) * count; scroll_window(context, direction == Direction::Forward ? offset : -offset); }