Skip to content

docs(installation): wrap vim.pack.add args in a list#3036

Merged
olimorris merged 2 commits intoolimorris:mainfrom
junjiexh:patch-1
Apr 15, 2026
Merged

docs(installation): wrap vim.pack.add args in a list#3036
olimorris merged 2 commits intoolimorris:mainfrom
junjiexh:patch-1

Conversation

@junjiexh
Copy link
Copy Markdown
Contributor

@junjiexh junjiexh commented Apr 15, 2026

Description

vim.pack.add expects a list of specs, but the current installation snippet passes bare strings / a single spec table. All three vim.pack.add calls in the snippet trigger the same error on Neovim 0.12:

vim/pack.lua: specs: expected list, got string/table

Before:

vim.pack.add("https://www.github.com/nvim-lua/plenary.nvim")
vim.pack.add("https://github.com/nvim-treesitter/nvim-treesitter")
vim.pack.add({
  src = "https://www.github.com/olimorris/codecompanion.nvim",
  version = vim.version.range("^19.0.0")
})

After — each arg is wrapped in an outer list so the snippet works as copy-pasted:

vim.pack.add({ "https://www.github.com/nvim-lua/plenary.nvim" })
vim.pack.add({ "https://github.com/nvim-treesitter/nvim-treesitter" })
vim.pack.add({ {
  src = "https://www.github.com/olimorris/codecompanion.nvim",
  version = vim.version.range("^19.0.0")
} })

AI Usage

Used Claude Code to spot the mismatch after hitting the runtime error locally and to draft this description.

Related Issue(s)

N/A

Screenshots

N/A

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
  • I've run `make all` to ensure docs are generated, tests pass and StyLua has formatted the code
  • (optional) I've added test coverage for this fix/feature
  • (optional) I've updated the README and/or relevant docs pages

@olimorris
Copy link
Copy Markdown
Owner

Great catch. Can you run make all so the vimdocs are updated too?

@junjiexh
Copy link
Copy Markdown
Contributor Author

Great catch. Can you run make all so the vimdocs are updated too?

Done. Thanks for the reminder

@olimorris olimorris merged commit cea5b18 into olimorris:main Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants