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: Failed to setup handlers for mini.surround with empty mappings entry #296

Closed
3 tasks done
echasnovski opened this issue Feb 18, 2023 · 2 comments · Fixed by #294
Closed
3 tasks done

bug: Failed to setup handlers for mini.surround with empty mappings entry #296

echasnovski opened this issue Feb 18, 2023 · 2 comments · Fixed by #294
Labels
bug Something isn't working

Comments

@echasnovski
Copy link
Contributor

Did you check docs and existing issues?

  • I have read all the LazyVim docs
  • I have searched the existing issues of LazyVim
  • I have searched the exsiting issues of plugins related to this issue

Neovim version (nvim -v)

0.8.3

Operating system/version

EndeavourOS Linux x86_64 (6.1.11-arch1-1)

Describe the bug

When using empty string as mappings entry in 'mini.surround', this error is shown:

Failed to setup handlers for mini.surround

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

# stacktrace:
  - vim/keymap.lua:0 _in_ **set**

Any mappings entry in any 'mini.nvim' module (except 'mini.pairs') can be an empty string with meaning to not create that particular mapping. Relevant modules for LazyVim are 'mini.ai', 'mini.comment', 'mini.indentscope', 'mini.surround'.

Steps To Reproduce

  1. Configure 'mini.surround' using, for example, this setup:
return {
  "echasnovski/mini.surround",
  opts = {
    mappings = {
      add = "ys",
      delete = "ds",
      find = "yf",
      find_left = "yF",
      highlight = "vs",
      replace = "cs",
      update_n_lines = "",
    },
    search_method = "cover_or_next",
  },
  config = function(_, opts)
    require("mini.surround").setup(opts)
  end,
}
  1. Open Neovim.

Expected Behavior

Empty string in mappings entry doesn't result into error.

Repro

No response

@folke
Copy link
Collaborator

folke commented Feb 18, 2023

Fixed!

@echasnovski
Copy link
Contributor Author

Nice!
I've thought that 'mini.ai' is also affected (as it also uses mappings to configure a/i and their next/last variants), but it seems LazyVim doesn't account for those. Only 'mini.surround' it is then.

ofrades pushed a commit to ofrades/LazyVim that referenced this issue May 30, 2023
joshmedeski pushed a commit to joshmedeski/LazyVim that referenced this issue Sep 1, 2023
yacineMTB pushed a commit to yacineMTB/LazyVim that referenced this issue Jun 19, 2024
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

Successfully merging a pull request may close this issue.

2 participants