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

<M-e> (Alt-e) is not working as expected #20

Closed
ayush-mandowara-bst opened this issue Feb 15, 2021 · 11 comments
Closed

<M-e> (Alt-e) is not working as expected #20

ayush-mandowara-bst opened this issue Feb 15, 2021 · 11 comments

Comments

@ayush-mandowara-bst
Copy link

OS: Windows 10 2004
**What vim?: NVIM v0.4.4
Reproduced in other variants of Vim?: VIM - Vi IMproved 8.2

Autopairs config:
Although not applicable by I have the following config:

let g:AutoPairsDirectoryBlacklist = [$HOME . '\.config\vim']

Actual Behaviour

  • Press <M-e> on a matching pair such as (), [], ''
  • No wrapping operation performed

Expected Behavior

  • word should be wrapped up by the matching pair
  • ()test_word
  • cursor represented by |
  • (|) press <alt-e> in insert mode
  • (test_word)
@ayush-mandowara-bst ayush-mandowara-bst added bug Something isn't working status:Triage labels Feb 15, 2021
@ayushxx7
Copy link

+1 (needed to raise the issue from this account)

@LunarWatcher
Copy link
Owner

#18

I remapped all the meta mappings. Tried thinking about backwards compatibility options, but none really stood out. Can't exactly push uninstrusive warnings about a future breaking change. The change hasn't been labeled yet, though, so you can switch over to the latest tag while I sort out backwards compatibility options. I'll probably have to look into backwards-compatible ways of changing it. I didn't expect it to be breaking within two days :ablobsweats:

I'll rush the backwards compat to prevent further breaking. That being said

If you're interested in the new mappings, see the help doc (or the changelog; only <C-f> for fast wrap isn't mentioned in it -- need to fix that though)

if you don't like them, or muscle memory makes you prefer the old ones, you can revert all the changes with:

let g:AutoPairsShortcutToggle='<M-p>'
let g:AutoPairsShortcutFastWrap='<M-e>'
let g:AutoPairsShortcutJump='<M-n>'
let g:AutoPairsShortcutBackInsert='<M-b>'

Or, again, switch to 3.0.0-beta5 by specifying { 'tag': '*'} (assuming vim-plug). There's only been one commit since the tag (the one changing mappings, to be specific), so you're not missing out on anything atm.

@ayushxx7
Copy link

cool thanks! I just switched to the tag.

  • Comment Plugin
  • :PlugClean
  • Add Plugin with tag
Plug 'LunarWatcher/auto-pairs', { 'tag': '*' }      " opening brackets / quotes will add a matching closing pair
  • :PlugInstall

Working as expected! 👍

@ayush-mandowara-bst
Copy link
Author

closing. refer to the comment above by @ayushxx7 if you face a similar issue.

@LunarWatcher
Copy link
Owner

LunarWatcher commented Feb 15, 2021

I'd actually like to leave this open until I sort out compatibility stuff, purely for tracking. Also makes it more clear that the issue is known and still relevant/active if anyone else runs into the same problem (which is likely to happen in the next 6-12 hours or so, when people return to work and stuff)

@LunarWatcher
Copy link
Owner

Went with a variable - not the most optimal option, but it's the best I can do for the time being. It's set to 1 by default, which means <M-e> (among others) can be mapped. If you prefer these keybinds, I recommend setting let g:AutoPairsCompatibleMaps = 1 to keep these keybinds -- I'll change the default to 0 some time in the future (though that'll at least be in a few months, so no rush). I'll keep the variable for backwards-compatibility with jiangmiao/auto-pairs regardless of the default, though.

@ayush-mandowara-bst
Copy link
Author

Alright, cool! I've added let g:AutoPairsCompatibleMaps = 1 to my settings.

@roachsinai
Copy link

@LunarWatcher for the lastest doc.txt version post below example about fastwrap:

        input: (|)'hello' (press (<M-e> at |)
        output: ('hello')

    Wrap string, only support c style string.
        input: |'h\\el\'lo' (press (<M-e> at |)
        output ('h\\ello\'')

        input: (|)[foo, bar()] (press (<M-e> at |)
        output: ([foo, bar()])

First, I think the first and third example () before piars and ( before <M-e> is redundant.

And for the sencond example: |'h\\el\'lo' (press (<M-e> at |) I got: ('h\\el\')lo'.

@LunarWatcher
Copy link
Owner

Yeah, that's me being dumb. Managed to miss the ( in front of the keybind.

@roachsinai
Copy link

Yeah, that's me being dumb. Managed to miss the ( in front of the keybind.

lol, thanks again for your work!

@LunarWatcher
Copy link
Owner

The second example being broken is not me being dumb though. Gotta investigate that separately (suspecting bad regex somewhere)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants