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: New updates breaking nvim-surround and similar surround manipulation plugins #837

Closed
4 tasks done
umutondersu opened this issue Aug 31, 2024 · 4 comments
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@umutondersu
Copy link

umutondersu commented Aug 31, 2024

Did you check docs and existing issues?

  • I have read all the which-key.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of which-key.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.10.1

Operating system/version

Pop!_OS 22.04 LTS

Describe the bug

With the new versions of this plugin, plugins used for surround manipulation such as nvim-surround and mini.surround do not function. They can still be used by searching the keymaps with telescope and choosing the specific keymap however normally they don't work at all and do not show in which-key. The last commit number i was using before this error occurred is 4433e5e. However I am not sure which update caused this issue.

Steps To Reproduce

  1. Have the last which-key and nvim-surround plugins.
  2. Try using nvim-surround

Expected Behavior

I expected nvim-surround to function.

Health

which-key: require("which-key.health").check()

- OK Most of these checks are for informational purposes only.
  WARNINGS should be treated as a warning, and don't necessarily indicate a problem with your config.
  Please |DON't| report these warnings as an issue.

Checking your config ~
- OK |mini.icons| is installed
- OK |nvim-web-devicons| is installed

Checking for issues with your mappings ~
- OK No issues reported

checking for overlapping keymaps ~
- WARNING In mode `n`, <gc> overlaps with <gcc>:
  - <gc>: Toggle comment
  - <gcc>: Toggle comment line
- WARNING In mode `n`, <ys> overlaps with <yss>:
  - <ys>: Add a surrounding pair around a motion (normal mode)
  - <yss>: Add a surrounding pair around the current line (normal mode)
- WARNING In mode `n`, <yS> overlaps with <ySS>:
  - <yS>: Add a surrounding pair around a motion, on new lines (normal mode)
  - <ySS>: Add a surrounding pair around the current line, on new lines (normal mode)
- OK Overlapping keymaps are only reported for informational purposes.
  This doesn't necessarily mean there is a problem with your config.

Checking for duplicate mappings ~
- OK No duplicate mappings found

Log

No response

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/which-key.nvim", opts = {} },
    {
    "kylechui/nvim-surround",
    version = "*",
    event = "VeryLazy",
    config = true,
},
  },
})
@umutondersu umutondersu added the bug Something isn't working label Aug 31, 2024
@umutondersu umutondersu changed the title bug: New updates braking nvim-surround and similar surround manipulation plugins bug: New updates breaking nvim-surround and similar surround manipulation plugins Sep 28, 2024
@baroldgene
Copy link

I'm experiencing the same with markdown.nvim. I was able to work around it by manually defining all the possible keymaps, but it's hacky and a bit ugly. Curious if there's a better way to define a keymap (description only, no RHS) where part of the middle of the keymap is a movement. For example I currently have it set up so that my hotkey to bold something in markdown is <leader>me%b where the % is a movement key. This can be one character (e.g. w) or multiple (e.g. iw) and I'm not sure how to define this in which-key other than to manually define both, which is essentially what I did, albeit by iterating over a list to create the mappings.

@definitelynotrazu
Copy link

Same here with mini.surround

@Blechlawine
Copy link

I had the same problem with mini.surround, but i got it somewhat working again by setting vim.o.timeout = false

@umutondersu
Copy link
Author

vim.o.timeout = false

This has solve the problem for me as well! Thank you very much!

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

4 participants