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]: jumps out of pair unexpectedly for multi-character pairs #101

Open
Bekaboo opened this issue Nov 10, 2024 · 0 comments
Open

[Bug]: jumps out of pair unexpectedly for multi-character pairs #101

Bekaboo opened this issue Nov 10, 2024 · 0 comments
Milestone

Comments

@Bekaboo
Copy link

Bekaboo commented Nov 10, 2024

For example, consider the following configuration:

require('ultimate-autopair').setup({
  { '\\(', '\\)' }
})

When the cursor is in the middle of \( and \), pressing \ will move the cursor out of the pairs. This is especially inconvenient when writing a regex expression, e.g. when you want to type \d inside the \(\) pair.

Proposal: Don't move cursor out of the pair on the first matching char (in this case, \), either disable this behavior for multi-char pairs or check and move the cursor on the last matching char intead of the first matching char, e.g. remove preceding backslash and move the cursor out of the \(\) pair on ) if we detect \ in front of the cursor.

@altermo altermo added this to the v0.7 milestone Dec 31, 2024
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