chrisgrieser / nvim-rip-substitute

Perform search and replace operations in the current buffer using a modern user interface and contemporary regex syntax.
MIT License
177 stars 7 forks source link

Bug: getting E5560: nvim_echo must not be called in a lua loop callback #7

Closed mriva closed 3 months ago

mriva commented 3 months ago

Make sure you have done the following

Bug Description

I installed the plugin with vim-plug, added the setup call with defaults as per README, but when I open nvim I get this error:

Error executing luv callback:
vim/_editor.lua:0: E5560: nvim_echo must not be called in a lua loop callback
stack traceback:
        [C]: in function 'nvim_echo'
        vim/_editor.lua: in function 'notify'
        ...plugged/nvim-rip-substitute/lua/rip-substitute/utils.lua:8: in function 'notify'
        ...lugged/nvim-rip-substitute/lua/rip-substitute/config.lua:61: in function 'on_exit'
        ...64-0.10.0-27fb629/share/nvim/runtime/lua/vim/_system.lua:300: in function <...64-0.10.0-27fb629/share/nvim/runtime/lua/vim/_system.lua:270>

Relevant Screenshot

No response

To Reproduce

  1. add Plug 'chrisgrieser/nvim-rip-substitute' to init.vim
  2. run PlugInstall
  3. reopen nvim

neovim version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
chrisgrieser commented 3 months ago

Rip-substitute does not even call nvim-echo. It only sends a notification when you are using ripgrep without pcre2 support, and on a successful replacement. In both cases, this sends a standard notification via vim.notify, which every other plugin does.

So the issue must be caused by either vim plug or your notification plugin, and in both cases unfortunately nothing I can do on my end, sorry.

As a temporary workaround, you might simply disable the notification setting and the pcre2 setting (or use a Rg build with pcre2), in which case no notification is ever send.

mriva commented 3 months ago

Thanks, using the right version of ripgrep fixed the issue

chrisgrieser commented 3 months ago

While I am glad it worked, it's only a bandage really. Most likely, there is some issue with your nvim config, and it will likely also cause trouble with other nvim plugins, so it might be worth looking into what's causing the problem.