Fix auto indent incorrect in CoffeeScript
eg: foo: bar: [|] press <CR> at |
This commit is contained in:
parent
cfbbc888cf
commit
3b74bdd5bf
@ -1,7 +1,7 @@
|
|||||||
" Insert or delete brackets, parens, quotes in pairs.
|
" Insert or delete brackets, parens, quotes in pairs.
|
||||||
" Maintainer: JiangMiao <jiangfriend@gmail.com>
|
" Maintainer: JiangMiao <jiangfriend@gmail.com>
|
||||||
" Last Change: 2011-06-10
|
" Last Change: 2011-09-06
|
||||||
" Version: 1.1.0
|
" Version: 1.1.1
|
||||||
" Homepage: http://www.vim.org/scripts/script.php?script_id=3599
|
" Homepage: http://www.vim.org/scripts/script.php?script_id=3599
|
||||||
" Repository: https://github.com/jiangmiao/auto-pairs
|
" Repository: https://github.com/jiangmiao/auto-pairs
|
||||||
|
|
||||||
@ -87,8 +87,6 @@ function! AutoPairsInsert(key)
|
|||||||
return open.close."\<Left>"
|
return open.close."\<Left>"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function! AutoPairsDelete()
|
function! AutoPairsDelete()
|
||||||
let line = getline('.')
|
let line = getline('.')
|
||||||
let prev_char = line[col('.')-2]
|
let prev_char = line[col('.')-2]
|
||||||
@ -166,7 +164,7 @@ function! AutoPairsReturn()
|
|||||||
if g:AutoPairsCenterLine && winline() * 1.5 >= winheight(0)
|
if g:AutoPairsCenterLine && winline() * 1.5 >= winheight(0)
|
||||||
let cmd = " \<C-O>zz\<ESC>cl"
|
let cmd = " \<C-O>zz\<ESC>cl"
|
||||||
end
|
end
|
||||||
return "\<CR>\<C-O>O".cmd
|
return "\<DEL>\<CR>".cur_char."\<C-O>O".cmd
|
||||||
end
|
end
|
||||||
return "\<CR>"
|
return "\<CR>"
|
||||||
endfunction
|
endfunction
|
||||||
@ -200,4 +198,4 @@ function! AutoPairsInit()
|
|||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
au BufRead,BufNewFile,BufCreate * :call AutoPairsInit()
|
au BufRead,BufNewFile,BufCreate,VimEnter * :call AutoPairsInit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user