hologram.nvim icon indicating copy to clipboard operation
hologram.nvim copied to clipboard

Periodical error

Open jkopano opened this issue 2 years ago • 5 comments

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.

jkopano avatar Sep 09 '23 12:09 jkopano

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.

lyndhurst avatar Nov 28 '23 13:11 lyndhurst

same problem

joelpeapen avatar Feb 23 '24 09:02 joelpeapen

same here if someone knows a fix let me know

simonlearnscoding avatar May 26 '24 08:05 simonlearnscoding

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 avatar Aug 02 '24 12:08 TamaMcGlinn

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

TamaMcGlinn avatar Aug 02 '24 12:08 TamaMcGlinn