mong8se / actually.nvim

A plugin to help load the file you actually meant to load.
GNU General Public License v3.0
55 stars 0 forks source link

Error in directory with '[braces]' #4

Closed aarondill closed 1 month ago

aarondill commented 1 month ago

Reproduction:

> mkdir -p 'file/[dir]'
> cd 'file/[dir]'
> nvim nonexistant
Error detected while processing BufNewFile Autocommands for "*"..BufNewFile Autocommands for "*
":
Error executing lua callback: Vim:E94: No matching buffer for /home/aaron/tmp/[dir]/nonexistant
stack traceback:
        [C]: in function 'swapname'
        ...ocal/share/nvim/lazy/actually.nvim/lua/actually/init.lua:18: in function <...ocal/sh
are/nvim/lazy/actually.nvim/lua/actually/init.lua:13>
        [C]: in function 'nvim_exec_autocmds'
        ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:161: in function <...hare/n
vim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:160>
        [C]: in function 'xpcall'
        .../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:135: in function 'try'
        ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:160: in function '_trigger'

        ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:143: in function 'trigger'
        ...hare/nvim/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:89: in function <...hare/nv
im/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:72>
aarondill commented 1 month ago

I encountered this problem while working with NextJS' routing slugs.

mong8se commented 1 month ago

Thanks for the report and thanks for using the plugin! I've pushed a fix.