ervandew / matchem

Vim plugin to auto add closing quotes, parens, brackets, curlies, etc.
21 stars 1 forks source link

<CR> bug #10

Closed kovetskiy closed 9 years ago

kovetskiy commented 9 years ago

example

seletskiy commented 9 years ago

Actually, not bounded to UltiSnips.

Bug is reproduceable with following typeset:

{1<Delete><CR>
ervandew commented 9 years ago

This also isn't tied to the <cr> mapping either. This can also be reproduced using simply:

{1<del><esc>

I've fixed the <del> mapping, but I haven't yet tested if this fixes the UltiSnips case yet or not. @kovetskiy: can you see if the lastest matchem version works properly with ultisnips now?

kovetskiy commented 9 years ago

@ervandew last version fix your and @seletskiy problems, but not fix my problem. And I can reproduce problem without UltiSnips. First:

['b<C-J><ESC>j

Second:

Aand now I cannot remove closing bracked ] with backspace. test[<ESC>A and try to backspace.

ervandew commented 9 years ago

I can reproduce the first problem but not the second.

For the first one, what behavior do you expect when using <c-j> at that position? Do you want the closing delimiters to remain on the current line or move to the new line? Is ultisnips using <c-j> internally, or is that just something you use manually?

kovetskiy commented 9 years ago

@ervandew it this case I'm used clear vim with only matchem plugin and set nocompatible.

ervandew commented 9 years ago

What about my other questions?

kovetskiy commented 9 years ago

@ervandew <C-J> should has behavior same as <CR>. In my last cases I don't used UltiSnips, and no, UltiSnips doesn't use <C-J> internally.

ervandew commented 9 years ago

Aand now I cannot remove closing bracked ] with backspace. test[<ESC>A and try to backspace. it this case I'm used clear vim with only matchem plugin and set nocompatible.

Try adding set backspace+=start as well, otherwise you are using vi compatible backspacing, which doesn't allow you to backspace past the start of the current insert.

ervandew commented 9 years ago

Latest commit adds support for <nl> (<c-j>).

kovetskiy commented 9 years ago

Hi, I've found yet another bug. I have this mapping: inoremap <C-A> <C-O>A Then I do:

[<C-A><ESC> After <ESC> matchem insert extra ].

ervandew commented 9 years ago

@kovetskiy That mapping bypasses matchem completely. Try using imap instead of inoremap so that matchem can be involved:

imap <c-a> <c-o>A
kovetskiy commented 9 years ago

@ervandew Ok, I got it, thank you! :+1:

seletskiy commented 9 years ago

@ervandew: Hi! I found another bug:

["|"]   press <Right>
[""]|
kovetskiy commented 9 years ago

@ervandew Hi! I found another bug: matchem does not work properly with vim abbreviations. ab if( if (

if(

and I got: if ( [cursor]))