Closed simonmandlik closed 4 months ago
Definitely! Hopefully soon I'll be doing a major refactor (switching to async delays etc) and I'll add this in
I've started refactoring here: https://github.com/declancm/cinnamon.nvim/tree/the-refactoring
I have only just started the refactoring so there will be many breaking changes and its missing many features but if you call the scroll function directly (require('cinnamon').scroll
) you can play around with the new callback functionality
Note: Haven't updated the README yet so you'll need to check the source for the new function args
Thanks for the heads-up. I will gladly wait for when it's completely finished 🙂
Let me know if you need any help with the testing once it's done
Getting very close to completing the re-write! It would be great if you could try it out
Callback option has been merged!
@declancm I have tested the rewritten version. Looks good!
Is it still possible to limit max total scroll time as in the previous version? (if options.delta * nsteps > max_scroll_time
, reduce options.delta
)
I have also noticed that there is conflicting behavior when using with Aasim-A/scrollEOF.nvim
, which I don't remember from the previous version.
I tried that plugin and it seems to be working fine, what behavior are you seeing?
Here's MWE
local root = vim.fn.fnamemodify("./.repro", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
local plugins = {
{
"declancm/cinnamon.nvim",
config = function()
require("cinnamon").setup {
keymaps = {
basic = true,
extra = false
},
}
end
},
{
'Aasim-A/scrollEOF.nvim',
config = true
}
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.o.scrolloff = 10
vim.o.nu = true
Sometimes when scrolling the blank space at the bottom is preserved, sometimes it is not. This is what happens when I start at the bottom of 29-line long file and try scrolling up and down (C-u
and C-d
):
https://github.com/declancm/cinnamon.nvim/assets/16707112/05804508-0b53-429d-a124-fc91fa318b32
When I'm moving up/down with j
/k
the blank space appears again
That commit should fix the issue :)
This would help with integration with other plugins, for example
hlslens.nvim
.Context: https://github.com/kevinhwang91/nvim-hlslens/issues/71#issuecomment-2179050589