Skip to content

Commit b3cde66

Browse files
jiangmiaovim-scripts
authored andcommitted
Version 1.2.4: fixes #20 Errors in pair creation that is split by ENTER
1 parent ed01a8d commit b3cde66

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ Compatible with Vimwiki - [issue #19](https://github.com/jiangmiao/auto-pairs/is
246246

247247
Breaks '.' - [issue #3](https://github.com/jiangmiao/auto-pairs/issues/3)
248248

249-
Description: After entering insert mode and inputing `[hello` then leave insert mode by `<ESC>`, press '.' will insert 'hello' instead of '[hello]'.
249+
Description: After entering insert mode and inputing `[hello` then leave insert
250+
mode by `<ESC>`. press '.' will insert 'hello' instead of '[hello]'.
250251
Reason: `[` actually equals `[]\<LEFT>` and \<LEFT> will break '.'
251252
Solution: none
252253

plugin/auto-pairs.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
" Insert or delete brackets, parens, quotes in pairs.
22
" Maintainer: JiangMiao <jiangfriend@gmail.com>
33
" Contributor: camthompson
4-
" Last Change: 2012-07-15
5-
" Version: 1.2.3
4+
" Last Change: 2012-08-17
5+
" Version: 1.2.4
66
" Homepage: http://www.vim.org/scripts/script.php?script_id=3599
77
" Repository: https://github.com/jiangmiao/auto-pairs
88

@@ -267,8 +267,8 @@ function! AutoPairsReturn()
267267
let cmd = ''
268268
let cur_char = line[col('.')-1]
269269
if has_key(g:AutoPairs, prev_char) && g:AutoPairs[prev_char] == cur_char
270-
if g:AutoPairsCenterLine && winline() * 1.5 >= winheight(0)
271-
let cmd = " \<C-O>zz\<ESC>cl"
270+
if g:AutoPairsCenterLine && winline() * 3 >= winheight(0) * 2
271+
let cmd = " \<C-O>zz\<BS>"
272272
end
273273
" conflict with javascript and coffee
274274
" javascript need indent new line

0 commit comments

Comments
 (0)