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

neoscroll.nvim/lua/neoscroll/init.lua:198: Vim(normal):E471: Argument required: normal! #33

Closed
hungrybirder opened this issue Jun 23, 2021 · 1 comment · Fixed by #36

Comments

@hungrybirder
Copy link

hungrybirder commented Jun 23, 2021

commit id=4cb8fe7c0e0cbed2fd0852e5ee7f4970359c9650
I open README.txt,
type
I get an error neoscroll.nvim/lua/neoscroll/init.lua:198: Vim(normal):E471: Argument required: normal!

It works well by using commit id=a1c9db5a3dcc900d98bc2efb6c10d3a8b08e42ef

image

My neoscroll config

require('neoscroll').setup({
    mappings = {'<C-u>', '<C-d>', '<C-b>', '<C-f>',
                '<C-y>', '<C-e>', 'zt', 'zz', 'zb'},
    hide_cursor = true,          -- Hide cursor while scrolling
    stop_eof = true,             -- Stop at <EOF> when scrolling downwards
    respect_scrolloff = false,   -- Stop scrolling when the cursor reaches the scrolloff margin of the file
    cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
    easing = false,              -- easing_function will be used in all scrolling animations with some defaults
    easing_function = function(x) return math.pow(x, 2) end -- default easing function
})

local t = {}
-- Syntax: t[keys] = {function, {function arguments}}
t['<C-u>'] = {'scroll', {'-vim.wo.scroll', 'true', '8'}}
t['<C-d>'] = {'scroll', { 'vim.wo.scroll', 'true', '8'}}
t['<C-b>'] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '7'}}
t['<C-f>'] = {'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '7'}}
t['<C-y>'] = {'scroll', {'-0.10', 'false', '20'}}
t['<C-e>'] = {'scroll', { '0.10', 'false', '20'}}
t['zt']    = {'zt', {'7'}}
t['zz']    = {'zz', {'7'}}
t['zb']    = {'zb', {'7'}}

require('neoscroll.config').set_mappings(t)
@bangedorrunt
Copy link

bangedorrunt commented Jun 23, 2021

This is neovim bug as mentioned in #11 and #28, to fix it use vim.opt_local.scrolloff = 0, and set use_local_scrolloff = true in your require('neoscroll').setup()

@karb94, I found this issue persists when restore a session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants