Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] bad argument #1 to 'ipairs' (table expected, got number) #44

Closed
barklan opened this issue Jun 14, 2023 · 3 comments
Closed

[Bug] bad argument #1 to 'ipairs' (table expected, got number) #44

barklan opened this issue Jun 14, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@barklan
Copy link

barklan commented Jun 14, 2023

Neovim version

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

Describe the bug

After commits 3d34816 - 42ccf4f

E5108: Error executing lua: ...al/share/nvim/lazy/bufdelete.nvim/lua/bufdelete/init.lua:192: bad argument #1 to 'ipairs' (table expected, got number)
stack traceback:
        [C]: in function 'ipairs'
        ...al/share/nvim/lazy/bufdelete.nvim/lua/bufdelete/init.lua:192: in function 'get_target_buffers'
        ...al/share/nvim/lazy/bufdelete.nvim/lua/bufdelete/init.lua:205: in function 'bufdelete'
        /home/barklan/.config/nvim/lua/config/keymaps_nvim.lua:17: in function </home/barklan/.config/nvim/lua/config/keymaps_nvim.lua:3>

To Reproduce

require('bufdelete').bufdelete(0)

Expected behavior

Delete current buffer

@barklan barklan added the bug Something isn't working label Jun 14, 2023
@barklan
Copy link
Author

barklan commented Jun 14, 2023

Calling with a table (require('bufdelete').bufdelete({0}) produces this:

E5108: Error executing lua: ...al/share/nvim/lazy/bufdelete.nvim/lua/bufdelete/init.lua:134: Vim:E516: No buffers were deleted
stack traceback:
        [C]: in function 'bdelete'
        ...al/share/nvim/lazy/bufdelete.nvim/lua/bufdelete/init.lua:134: in function 'buf_kill'
        ...al/share/nvim/lazy/bufdelete.nvim/lua/bufdelete/init.lua:205: in function 'bufdelete'
        /home/barklan/.config/nvim/lua/config/keymaps_nvim.lua:17: in function </home/barklan/.config/nvim/lua/config/keymaps_nvim.lua:3>

@Zeioth
Copy link

Zeioth commented Jun 15, 2023

Seems to be broken: Calling it as described in the documentation.

require("bufdelete").bufdelete(0, true) -- Says arg 1 should be a table
require("bufdelete").bufdelete({0}, true) -- But passing a table Vim:E516: No buffers were deleted

@famiu
Copy link
Owner

famiu commented Jun 15, 2023

Should be fixed now with the latest commit

@famiu famiu closed this as completed Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants