-
Notifications
You must be signed in to change notification settings - Fork 54
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
Flashing display during paragraph movement #99
Comments
Not really much I can do about it since keymaps are supposed to use |
I wouldn't know exactly how but https://github.com/MeanderingProgrammer/render-markdown.nvim manages this without any particular changes on my side. 2024-08-10.10-42-43.mp4 |
|
If the flashing occurs due to a sort of "auto-toggle" that this plugin implements then I can see a route forward. The cause of the flashing is due to rapid inputs to Edit: To be clear about the suggestion, the code would basically be like, instead of -- Some code ...
do_the_auto_toggle() It'd instead be something like local function debounce_trailing(fn, ms, first)
-- The usual debouncer logic
local save_mode = get_vim_current_mode() -- normal, command-line, etc
local run_if_in_same_mode = function()
local current_mode = get_vim_current_mode() -- normal, command-line, etc
if current_mode == saved_mode then
fn()
end
end
-- Normal debouncy-type logic.
-- Shortened to be concise - Real implementation is shown at https://gist.github.com/runiq/31aa5c4bf00f8e0843cd267880117201
timer:start(ms, 0, function()
pcall(vim.schedule_wrap(run_if_in_same_mode), unpack(argv, 1, argc))
end)
-- etc etc
end
local toggler = debounce_trailing(do_the_auto_toggle, 50)
-- Some code ...
toggler() So if the user has already exited the mode that they were in when the toggler was initially called, the toggle is skipped. e.g. if they enter |
My plugin can in fact run in any and all modes, this is incorrect |
Have you done all of these?
Describe the bug
When pressing
{
or}
the markview plugin changes back to ASCII, causing a flash on the screen.Neovim version
nvim --version # Output
Are you using a distro?
No
To Reproduce
Steps to reproduce the bug:
reproduction.lua file
markdown
document.Move around with
}
and{
keysExpected behavior
No flashing
Actual behavior
The windows flashes as you move. I enabled
hybrid_modes = { "n" },
so that the flashing will stop though it isn't my preferred mode.I'm guessing the reason for the flash is because markview seems to disable its extmarks when the user goes into command-line mode, which I think
vim-ipmotion
has to do in order to call its vimscript paragraph function. So the bug outlined here I think would happen with basically any mapping that calls out to vim / lua.Edit: I also got the flashing to stop by adding
modes = { "n", "no", "c" },
to the configurationRecording
(Warning: Flashing colors)
2024-08-10.09-47-43.mp4
The text was updated successfully, but these errors were encountered: