Skip to content

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

@Bekaboo

Description

@Bekaboo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions