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

cannot insert closing brace within nested section. #104

Open
adamski opened this issue Apr 2, 2015 · 6 comments
Open

cannot insert closing brace within nested section. #104

adamski opened this issue Apr 2, 2015 · 6 comments

Comments

@adamski
Copy link

adamski commented Apr 2, 2015

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?

@jiangmiao
Copy link
Owner

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

@danihodovic
Copy link

@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.

@RedX2501
Copy link

+1 have the same problem here

@ivanalejandro0
Copy link

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 added a commit to ivanalejandro0/nvim.config that referenced this issue Dec 12, 2015
@mzlogin
Copy link

mzlogin commented Jan 1, 2016

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

The g:AutoPairsFlyMode is default 0, just

let g:AutoPairsMultilineClose = 0

Thanks.

@PezCoder
Copy link

PezCoder commented Feb 16, 2018

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

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

7 participants