HampusHauffman / block.nvim

209 stars 2 forks source link

fix: extarks scroll with horizontal scroll #15

Closed nyngwang closed 1 year ago

nyngwang commented 1 year ago

Close #4.

I hope this one can be merged first since my further PRs might depend on this one. Thank you!

Notes

  1. By specifying a group with clear = true when creating autocmd can avoid many performance issues caused by redundant identical autocmds.
  2. I also tried WinScrolled but its performance was really bad, so my final decision is CursorHold to have good performance but regression of UX as the trade-off.
    • we need to expose update so that it can be called by an autocmd.
  3. pcall is needed. I encountered an error when writing the PR.
  4. checking for l is needed. I encountered an error when writing the PR.
HampusHauffman commented 1 year ago

Nice! Will look at this asap (probably Saturday unfortunately)

nyngwang commented 1 year ago

Great, I just found that vim.schedule saves it. Before 5208611 everything seems frozen.

HampusHauffman commented 1 year ago

https://github.com/HampusHauffman/block.nvim/tree/scroll @nyngwang Could you try this out see if it works well for you. I took a lot of inspiration from your code but made it a bit more in line with the current code style. If you could try it i'll merge it to master

nyngwang commented 1 year ago

Yes, that can work, thank you! (sorry for my "make-it-work-first" writing style :P Still need to learn more about Lua)