karb94 / neoscroll.nvim

Smooth scrolling neovim plugin written in lua
MIT License
1.42k stars 35 forks source link

bug: laggy with multiple window panes #93

Open steveshi7 opened 7 months ago

steveshi7 commented 7 months ago

This works great with only one window pane but I notice noticeable lag when there is more than one.

Example (gif compression made this ~30% more sluggish than it actually is): ezgif-4-03007650fc

config:

    {
        "karb94/neoscroll.nvim",
        enabled = true,
        config = function()
            local t    = {}
            -- Syntax: t[keys] = {function, {function arguments}}
            t['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '80', [['sine']] } }
            t['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '80', [['sine']] } }
            require('neoscroll.config').set_mappings(t)
        end
    },
karb94 commented 6 months ago

can you try this from #80:

require('neoscroll').setup({
    pre_hook = function()
        vim.opt.eventignore:append({
            'WinScrolled',
            'CursorMoved',
         })
    end,
        post_hook = function()
        vim.opt.eventignore:remove({
            'WinScrolled',
            'CursorMoved',
        })
    end,
})
steveshi7 commented 6 months ago

can you try this from #80:

require('neoscroll').setup({
    pre_hook = function()
        vim.opt.eventignore:append({
            'WinScrolled',
            'CursorMoved',
         })
    end,
        post_hook = function()
        vim.opt.eventignore:remove({
            'WinScrolled',
            'CursorMoved',
        })
    end,
})

Unfortunately, this issue persists even after using the above fix.

karb94 commented 2 weeks ago

Is this still an issue? Does this happen only with specific LSPs or file types? I'd be good if you can check if it's reproducible without other plugins active.