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

Error when switch buffer

Open ray-x opened this issue 2 years ago • 8 comments

When buffer switch got following error: It may be caused by hydra floating windows not exited properly. The hydra timer is still running but the hydra floating window is destroyed.

E5555: API call: Buffer is not 'modifiable'                                                                                                                                           
Error detected while processing function <lambda>2371[1]..<SNR>97_render_lines_from_timer[7]..<SNR>97_render_lines[86]..<SNR>101_delete_all_lines:                                    
line    1:                                                                                                                                                                            
E5555: API call: Buffer is not 'modifiable'                                                                                                                                           
Error detected while processing function <lambda>2457[1]..<SNR>97_render_lines_from_timer[7]..<SNR>97_render_lines[86]..<SNR>101_delete_all_lines:    

ray-x avatar Jun 25 '22 09:06 ray-x

Can't reproduce. Need more info.

anuvyklack avatar Jun 25 '22 09:06 anuvyklack

If hydra exits correctly with keymaps, there will not be any errors. One way to reproduce

  1. create a hydra floatwindows
  2. use mouse to click the floating window
  3. enter some command in command line ( I have plugins e.g. wilder and cmp autocomplete enabled when entering command mode and will create a floating window)
  4. see errors.

ray-x avatar Jun 25 '22 12:06 ray-x

Still can't reproduce. I don't use wilder, but with cmp the command line and buffer completion float windows work fine together with hydra hint window.

anuvyklack avatar Jun 25 '22 14:06 anuvyklack

Can you make a video? Or share a minimal config to reproduce.

anuvyklack avatar Jun 25 '22 14:06 anuvyklack

https://user-images.githubusercontent.com/1681295/175803574-c32a716b-3e64-4cf7-aa7c-f325944e9346.mp4

I think might be wilder.nvim

ray-x avatar Jun 26 '22 07:06 ray-x

This is very strange. You wouldn't be able to select hint window. I use vim.api.nvim_open_win with focusable = false

anuvyklack avatar Jun 27 '22 20:06 anuvyklack

@ray-x I remember that there is a bug in bufdir.nvim due to read-only buffer: https://github.com/elihunter173/dirbuf.nvim/issues/45

Does restoring your neovim version before https://github.com/neovim/neovim/commit/0cf5cd1ac9c8ec31c1d2f1b1a6585153a45fc4e9 fix the issue for you? Not sure though about the exact semantics of what neovim considers as "nofile".

Otherwise, you need to provide a minimal config.

matu3ba avatar Sep 26 '22 21:09 matu3ba

I updated to neovim latest and it still occurs. I am not using dirbuf.nvim But I using wilder.nvim which may related to this. And the error is from here:

  if a:state.api.need_timer()
    let l:render_id = a:state.render_id
    call timer_start(0, {-> s:render_lines_from_timer(l:render_id, a:state, a:ctx, a:result)})  <-- here
  else
    call s:render_lines(a:state, a:ctx, a:result)

https://github.com/gelguy/wilder.nvim/blob/addb378c2ae41d3d4fbd214ca525eb1f2b2855e5/autoload/wilder/renderer/popupmenu.vim#L187-L193

Not quite sure if this is related: https://github.com/gelguy/wilder.nvim/issues/140

ray-x avatar Sep 27 '22 06:09 ray-x