diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index 200b2dd..0a263cb 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -380,27 +380,23 @@ function! AutoPairsReturn() let cur_char = line[col('.')-1] if has_key(b:AutoPairs, prev_char) && b:AutoPairs[prev_char] == cur_char if g:AutoPairsCenterLine && winline() * 3 >= winheight(0) * 2 - " Use \ instead of \cl will cause the placeholder deleted - " incorrect. because zz won't leave Normal mode. - " Use \ is a bit wierd. the character before cursor need to be deleted. - " Adding a space, recentering, and deleting it interferes with default - " whitespace-removing behavior when exiting insert mode. - let cmd = "\zzcc" + " Recenter before adding new line to avoid replacing line content + let cmd = "zz" end " If equalprg has been set, then avoid call = " https://github.com/jiangmiao/auto-pairs/issues/24 if &equalprg != '' - return "\O".cmd + return "\".cmd."O" endif " conflict with javascript and coffee " javascript need indent new line " coffeescript forbid indent new line if &filetype == 'coffeescript' || &filetype == 'coffee' - return "\k==o".cmd + return "\".cmd."k==o" else - return "\=ko".cmd + return "\".cmd."=ko" endif end return ''