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

Issue typing closing paren

Open dderg opened this issue 7 years ago • 9 comments

i have code:

import request from '../request';

export const setTags = () => ({
    
}|

export const loadTags = () => {
    return async (dispatch) => {
        let result = await request('/tags');
        console.log(result);
    };
};

when i type ) i get:

import request from '../request';

export const setTags = () => ({
    
}

export const loadTags = ()| => {
    return async (dispatch) => {
        let result = await request('/tags');
        console.log(result);
    };
};

dderg avatar Apr 16 '17 12:04 dderg

Closes fine for me.

woat avatar Apr 19 '17 05:04 woat

strange...

dderg avatar Apr 19 '17 05:04 dderg

Maybe you have another plugin that's causing that?

woat avatar Apr 19 '17 05:04 woat

I've changed auto-pairs to https://github.com/Raimondi/delimitMate and issue is gone

dderg avatar Apr 19 '17 05:04 dderg

I'm having similar issues. prog666's example is working correctly for me too but I have had it happen with JavaScript, Python and PHP.

I haven't found a consistent pattern of when it happens, but I did manage to reproduce it with this simple example: https://asciinema.org/a/xrwwV1CkuHPn7PWhyE3T3hgij

I'm using vim 7.4 on this machine but I also have the issue with vim 8

Terr avatar Aug 03 '17 12:08 Terr

I've faced this countless times, this is how you can reproduce:

function() {
    const x = {
};

Copy paste this code & go back to normal mode go back to insert mode & try to close the bracket after x = { It'll go to the next closing bracket rather than putting a new closing bracket.

PezCoder avatar Nov 05 '17 12:11 PezCoder

@prog666 delimitMate handles it really well, but it has bugs of itself (UI bug that i faced). I would rather prefer it to get fixed in this library as everything seems to work really for me with it. But maybe we can use delimitMate as an inspiration to fix it

PezCoder avatar Nov 05 '17 12:11 PezCoder

Any updates on this? I was going to raise a new issue -- however I've found this thread.

Is it appropriate to describe the issue as "Flying to closing bracket when typing the closing bracket with the caret inside an unclosed bracket"?

sunnypp avatar Feb 03 '18 16:02 sunnypp

This is incredibly annoying, but it looks like they found a solution in another thread: https://github.com/jiangmiao/auto-pairs/issues/104

Add these lines to your vimrc:

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

It's fixed the problem for me :)

jordansoltman avatar Feb 15 '18 21:02 jordansoltman