carbon-steel / detour.nvim

Use popup windows to navigate files/buffer and to contain shells/TUIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: 'width' key must be a positive Integer

jonahfang opened this issue · comments

When I run 'require("detour").Detour()' I get the following error:

E5108: Error executing lua: ...vim/data/confignext/lazy/detour.nvim/lua/detour/init.lua:206: 'width' key must be a positive Integer
stack traceback:
        [C]: in function 'nvim_open_win'
        ...vim/data/confignext/lazy/detour.nvim/lua/detour/init.lua:206: in function 'popup'
        ...vim/data/confignext/lazy/detour.nvim/lua/detour/init.lua:255: in function 'Detour'
        /Users/fzx/adev/nvim/confignext/lua/plugins/detour.lua:46: in function 'show_popup'
        /Users/fzx/adev/nvim/confignext/lua/plugins/detour.lua:117: in function </Users/fzx/adev/nvim/confignext/lua/plugins/detour.lua:110>

Thanks for reporting the issue! I was able to get the error to appear on my system (simply by forcing the popup to become too small). It revealed some off-by-one errors I had in my code. I am not sure if this is exactly what happened with your bug but I'll assume it is. I'm working on patching this up.

With the release of v1.2.0, I've redone the arithmetic for constructing window dimensions. i think this should have fixed your issue, but please let me know if you find otherwise. Closing this issue for now. Feel free to open it again.