jiangmiao / auto-pairs

Vim plugin, insert or delete brackets, parens, quotes in pair
http://www.vim.org/scripts/script.php?script_id=3599
4.11k stars 373 forks source link

Strange behavior in (at least) JSON files #231

Closed dsifford closed 5 years ago

dsifford commented 5 years ago

I've recently noticed a strange behavior of this plugin in JSON files. It's easily reproducible using the following contents...

{
    "foo": "bar",
    "foo": "bar"
}

What happens

(| = cursor)

{
    "foo": "bar",
    |
    "foo": "bar"
}

In insert mode, type "

{
    "foo": "bar",

    "|foo": "bar"
}

What I'd expect to happen

Since, the next " comes after a line break, I wouldn't expect the plugin to jump my cursor there. Instead, I'd expect this...

{
    "foo": "bar",
    "|
    "foo": "bar"
}