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

Stop working with tpope/vim-unimpaired #64

Closed
anuvyklack opened this issue May 12, 2021 · 5 comments
Closed

Stop working with tpope/vim-unimpaired #64

anuvyklack opened this issue May 12, 2021 · 5 comments

Comments

@anuvyklack
Copy link

After 222a8ee a bug appeared.

To reproduce:

  1. Install tpopt/vim-unimpaired
  2. Press [<Space> or ]<Space> in any buffer to add empty line above / below the current line.
  3. Press " to use registers.

After this I get message:

E5108: Error executing lua Vim:E121: Undefined variable: a:count
@anuvyklack
Copy link
Author

This bug existed before 222a8ee also.

@anuvyklack
Copy link
Author

This is my `:checkhealth` output, if it may help

## WhichKey: checking conflicting keymaps
  - WARNING: conflicting keymap exists for mode **"o"**, lhs: **"i"**
  - INFO: rhs: `targets#e('o', 'i', 'i')`
  - WARNING: conflicting keymap exists for mode **"o"**, lhs: **"a"**
  - INFO: rhs: `targets#e('o', 'a', 'a')`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"yS"**
  - INFO: rhs: `<Plug>YSurround`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"ys"**
  - INFO: rhs: `<Plug>Ysurround`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"]u"**
  - INFO: rhs: `<Plug>unimpaired_url_decode`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"]x"**
  - INFO: rhs: `<Plug>unimpaired_xml_decode`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"]y"**
  - INFO: rhs: `<Plug>unimpaired_string_decode`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"g<lt>"**
  - INFO: rhs: `<Plug>TComment_Uncomment`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc"**
  - INFO: rhs: `<Plug>TComment_gc`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc4"**
  - INFO: rhs: `<Plug>TComment_gc4`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc8"**
  - INFO: rhs: `<Plug>TComment_gc8`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc1"**
  - INFO: rhs: `<Plug>TComment_gc1`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc5"**
  - INFO: rhs: `<Plug>TComment_gc5`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc9"**
  - INFO: rhs: `<Plug>TComment_gc9`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc6"**
  - INFO: rhs: `<Plug>TComment_gc6`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc3"**
  - INFO: rhs: `<Plug>TComment_gc3`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc7"**
  - INFO: rhs: `<Plug>TComment_gc7`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc2"**
  - INFO: rhs: `<Plug>TComment_gc2`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"g>"**
  - INFO: rhs: `<Plug>TComment_Comment`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"[u"**
  - INFO: rhs: `<Plug>unimpaired_url_encode`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"[x"**
  - INFO: rhs: `<Plug>unimpaired_xml_encode`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"[y"**
  - INFO: rhs: `<Plug>unimpaired_string_encode`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"m"**
  - INFO: rhs: `:<C-U>call signature#utils#Input()<CR>`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **";"**
  - INFO: rhs: `<Plug>(easymotion-prefix)`
  - WARNING: conflicting keymap exists for mode **"v"**, lhs: **"i"**
  - INFO: rhs: `targets#e('o', 'i', 'i')`
  - WARNING: conflicting keymap exists for mode **"v"**, lhs: **"a"**
  - INFO: rhs: `targets#e('o', 'a', 'a')`

@folke
Copy link
Owner

folke commented May 13, 2021

This is a really weird bug. I have no idea where that a:count is coming from. Somehow the unimpaired code runs when pulling registers. Will investigate further.

@folke
Copy link
Owner

folke commented May 13, 2021

The problem was with the last expression = register, which is set by unimpaired and gave an error when executing. I simply wrapped pulling registers in a pcall to make it work again. Should be fixed now.

@anuvyklack
Copy link
Author

Everything works now! Thank you! Awesome plugin!

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

No branches or pull requests

2 participants