filipdutescu / renamer.nvim

VS Code-like renaming UI for Neovim, writen in Lua.
Apache License 2.0
304 stars 11 forks source link

Lua errors when renaming [Bug] #139

Open evert opened 7 months ago

evert commented 7 months ago

Describe the bug

I got the following error pressing F2 in insert mode:

stack traceback:
        ...cal/share/nvim/plugged/renamer.nvim/lua/renamer/init.lua:274: in function '_create_default_popup_opts'
        ...cal/share/nvim/plugged/renamer.nvim/lua/renamer/init.lua:140: in function 'rename'
        [string ":lua"]:1: in main chunk

Environment

Rydwxz commented 6 months ago

I had the exact same problem:

E5108: Error executing lua: ....local/share/nvim/lazy/renamer.nvim/lua/renamer/init.lua:274: attempt to index local 'p' (a nil value)                                                                                                                                                                                   
stack traceback:                                                                                                                                                                                                                                                                                                        
        ....local/share/nvim/lazy/renamer.nvim/lua/renamer/init.lua:274: in function '_create_default_popup_opts'                                                                                                                                                                                                       
        ....local/share/nvim/lazy/renamer.nvim/lua/renamer/init.lua:140: in function 'rename'                                                                                                                                                                                                                           
        /home/rw/.config/nvim/lua/kmp.lua:63: in function </home/rw/.config/nvim/lua/kmp.lua:63>

I looked at that code and there was only one possible reason that that variable wouldn't be defined, and it was that require('renamer').setup() had never run. I added opts = {}, to my lazy config and all works well :)