auto-pairs icon indicating copy to clipboard operation
auto-pairs copied to clipboard

cannot insert closing brace within nested section.

Open adamski opened this issue 9 years ago • 6 comments

if I have something like

function(a, b)  {
    a[b.name] = b.thing;
    return a;
}

and I want to add a new statement e.g.

function(a, b)  {
    if (b) {
        a[b.name] = b.thing;
        return a;
    }
}

when I type if (b) { and get if (b) {}, I then delete the } and move down to insert the closing curly brace, it just auto-jumps to the outer curly brace rather than inserting:

function(a, b)  {
    if (b) {
        a[b.name] = b.thing;
        return a;
}|

and I have to insert on the same line as the outer brace and then make a newline and auto-indent to put things back. Is there something I am doing wrong, or is this expected behaviour?

adamski avatar Apr 02 '15 10:04 adamski

let g:AutoPairsMultilineClose = 0 to turn off the feature.

jiangmiao avatar Apr 06 '15 13:04 jiangmiao

@jiangmiao This doesn't work if you delete a bracket/brace and then reinsert it, it will automatically jump to the next occurrence of that symbol (even with g:AutoPairsMultilineClose disabled)

Edit: Both let g:AutoPairsMultilineClose = 0 and let g:AutoPairsFlyMode = 0 have to be 0.

danihodovic avatar Apr 28 '15 21:04 danihodovic

+1 have the same problem here

RedX2501 avatar Jul 14 '15 08:07 RedX2501

I had the same issue. Using these lines fixed the issue for me.

let g:AutoPairsMultilineClose = 0
let g:AutoPairsFlyMode = 0

Thanks @jiangmiao and @danihodovic !

ivanalejandro0 avatar Dec 12 '15 19:12 ivanalejandro0

+1 have the same problem, and @ivanalejandro0 's solution worked for me.

The g:AutoPairsFlyMode is default 0, just

let g:AutoPairsMultilineClose = 0

Thanks.

mzlogin avatar Jan 01 '16 16:01 mzlogin

Fly mode is actually a really good feature, it's sad that we have to choose between one of these two feature.

PezCoder avatar Feb 16 '18 16:02 PezCoder