Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Duplicate) Add time_scale option #91

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
```

Expand Down
1 change: 1 addition & 0 deletions lua/neoscroll/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions lua/neoscroll/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down