diff --git a/README.md b/README.md index 4719f48..d28066c 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ require('neoscroll').setup({ pre_hook = nil, -- Function to run before the scrolling animation starts post_hook = nil, -- Function to run after the scrolling animation ends performance_mode = false, -- Disable "Performance Mode" on all buffers. + time_scale = 1.0 -- Default time scale }) ``` diff --git a/lua/neoscroll/config.lua b/lua/neoscroll/config.lua index 8ecf085..0221b54 100644 --- a/lua/neoscroll/config.lua +++ b/lua/neoscroll/config.lua @@ -7,6 +7,7 @@ config.options = { respect_scrolloff = false, cursor_scrolls_alone = true, performance_mode = false, + time_scale = 1.0, } function config.set_options(custom_opts) diff --git a/lua/neoscroll/init.lua b/lua/neoscroll/init.lua index 029569e..8fdae21 100644 --- a/lua/neoscroll/init.lua +++ b/lua/neoscroll/init.lua @@ -238,6 +238,7 @@ local neoscroll = {} -- move_cursor: scroll the window and the cursor simultaneously -- easing_function: name of the easing function to use for the scrolling animation function neoscroll.scroll(lines, move_cursor, time, easing_function, info) + time = time * config.options.time_scale -- If lines is a fraction of the window transform it to lines if utils.is_float(lines) then lines = utils.get_lines_from_win_fraction(lines)