Skip to content
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

Periodical error #41

Open
Mugworth opened this issue Sep 9, 2023 · 5 comments
Open

Periodical error #41

Mugworth opened this issue Sep 9, 2023 · 5 comments

Comments

@Mugworth
Copy link

Mugworth commented Sep 9, 2023

Hello, after just sitting in vim doing some editing i get this error, it does not show that often, but i can't think of the reason why it's showing up.

Error executing vim.schedule lua callback: ...ocal/share/nvim/lazy/hologram.nvim/lua/hologram/init.lua:47: Invalid buffer id: 49                                                                                                        
stack traceback:                                                                                                    
        [C]: in function 'nvim_buf_get_extmarks'                                                                    
        ...ocal/share/nvim/lazy/hologram.nvim/lua/hologram/init.lua:47: in function 'buf_render_images'             
        ...ocal/share/nvim/lazy/hologram.nvim/lua/hologram/init.lua:17: in function <...ocal/share/nvim/lazy/hologram.nvim/lua/hologram/init.lua:17> 

Other than that, plugin works just fine.

@lyndhurst
Copy link

I got it working pretty easily too, but I get the same error message.
In my case, the message is thrown every time I save the buffer :w<Cr>.

Thanks for your time.

@joelpeapen
Copy link

same problem

@simonlearnscoding
Copy link

same here if someone knows a fix let me know

@TamaMcGlinn
Copy link

I just get a bunch of these errors, and if I ignore them and continue for a while, there seems to be some infinite loop so my whole NeoVim crashes. Adding a check for invalid bufnr is trivial; add the check in lua/hologram/init.lua

function hologram.buf_render_images(buf, top, bot)
  if not vim.fn.bufexists(buf) then
    return
  end
...

but the plugin is still unable to remove images again when I switch to a different buffer. This makes hologram unusable at present.

@TamaMcGlinn
Copy link

This PR fixes the issue. For anyone encountering this later, just switch to lucasdf/hologram.nvim to get the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants