ghostbuster91 / nvim-next

Apache License 2.0
29 stars 6 forks source link

attempt to index field 'default_mappings' (a boolean value) #3

Closed Hubro closed 1 year ago

Hubro commented 1 year ago

Tried using nvim-next as documented in README:

(with lazy.nvim):

  {
    "ghostbuster91/nvim-next",
    config = function()
      local builtins = require("nvim-next.builtins")

      require("nvim-next").setup({
        default_mappings = true, -- Overrides ; and ,
        repeat_style = "directional",
        items = {
          builtins.f,
          builtins.t,
        },
      })
    end,
  },

Got:

Failed to run `config` for nvim-next

.../.local/share/nvim/lazy/nvim-next/lua/nvim-next/init.lua:14: attempt to index field 'default_mappings' (a boolean value)

# stacktrace:
  - init_plugins.lua:69 _in_ **config**
  - init_plugins.lua:20
  - vim/_editor.lua:0 _in_ **cmd**
  - init.lua:28 _in_ **init**
  - init.lua:46

Looks like the README is probably outdated if the plugin now expects default_mappings to be a table (?)

ghostbuster91 commented 1 year ago

Indeed, thanks for reporting. The correct way to configure it is:

local nvim_next_builtins = require("nvim-next.builtins") 
 require("nvim-next").setup({ 
     default_mappings = { 
         repeat_style = "directional", 
     }, 
     items = { 
         nvim_next_builtins.f, 
         nvim_next_builtins.t 
     } 
 })

I will update the readme.