-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Is it possible to eliminate the flash of an unpadded buffer? #428
Comments
Hey, thanks for reporting and using the plugin :) I currently rely on Sadly most of the other events earlier in the loop (e.g. The only solution I see is to introduce a
Just wondering, are you running your own autocmd or are you using the provided |
Food for thought: I’m suspicious of any solution that relies on being “fast,” because that suggests to me that it’s asynchronous. When I start Neovim in a vsplit mode with
I’ve tried it out, it doesn’t fix the flicker.
For the testing above, I did. I sort of use |
So I found that the source of the issue is the debouncing logic. I’ve fixed the flicker by skipping debouncing like so: vim.api.nvim_create_autocmd({ "VimEnter" }, {
pattern = "*",
once = true,
callback = function()
require("no-neck-pain.main").enable("")
end,
}) I think that no debouncing should be the default for start-up. Debouncing only causes the layout shift. |
sorry for the delay I took some time off with the holidays, and thanks for following up with more investigation!!
The thing is that not every dashboard/file browser etc. are implemented the same way, so I had to introduce some debouncing logic to prevent race conditions with other plugins. e.g. with
Ah that make sense, I guess it messes up with the event loop even with the 2ms default that we have, even with 0 it still creates the flicker. I need to do some more tests with the other integrations |
I've removed the debounce in #429 in case you'd like to experiment |
oh I think I found a sane I need to do more tests with other integrations |
Describe the problem
I have configured No Neck Pain to start on VimEnter. Even with this setting, the plugin adds padding only after a buffer and its window are loaded and displayed, e.g., when I do
nvim SOME_FILE
. This causes a visible flash of unpadded buffer, which, like flash of unstyled content), is unpleasant.Describe the solution
I don’t know how to solve this, but I haven’t researched this. It would be nice if the pads could be calculated and added before the buffer is displayed.
Notes
Thank you so much for this plugin. I use it every day.
The text was updated successfully, but these errors were encountered: