kylechui / nvim-surround

Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.
MIT License
2.98k stars 60 forks source link

Setting any option in `keymaps` to an empty string yields error #204

Closed luiz00martins closed 1 year ago

luiz00martins commented 1 year ago

Checklist

Neovim Version

NVIM v0.9.0-dev-849+g7880eeb2e

Plugin Version

Tagged (Stable)

Minimal Configuration

require('nvim-surround').setup {
    keymaps = {
        insert = "",
        insert_line = "",
        normal = "s",
        normal_cur = "ss",
        normal_line = "yS",
        normal_cur_line = "ySS",
        visual = "s",
        visual_line = "S",
        delete = "ds",
        change = "cs",
    },
}

Sample Buffer

none

Keystroke Sequence

none

Expected behavior

The mapping would be ignored (not created).

Actual behavior

Error:

vim/keymap.lua:0: Invalid (empty) LHS

# stacktrace:
  - vim/keymap.lua:0 _in_ **set**
  - .config/nvim/init/plugins_portable.lua:1330 _in_ **config**
  - lua:40

Additional context

No response

kylechui commented 1 year ago

They should be set to false to disable them.

luiz00martins commented 1 year ago

Yep, seems to work. Thank you.

Is this not still a bug though? If not, you can close.

kylechui commented 1 year ago

No, as setting the LHS of a keymap to an empty string doesn't make sense.