Improve Fast Wrap on
a && |) b e|) <foo>
This commit is contained in:
parent
248d091b0a
commit
e379fa2316
@ -1,7 +1,7 @@
|
||||
" Insert or delete brackets, parens, quotes in pairs.
|
||||
" Maintainer: JiangMiao <jiangfriend@gmail.com>
|
||||
" Last Change: 2011-06-10
|
||||
" Version: 1.0.3
|
||||
" Version: 1.1.0
|
||||
" Homepage: http://www.vim.org/scripts/script.php?script_id=3599
|
||||
" Repository: https://github.com/jiangmiao/auto-pairs
|
||||
|
||||
@ -117,6 +117,11 @@ function! AutoPairsFastWrap()
|
||||
let line = getline('.')
|
||||
let current_char = line[col('.')-1]
|
||||
let next_char = line[col('.')]
|
||||
|
||||
" Ignore EOL
|
||||
if col('.') == col('$')
|
||||
return ''
|
||||
end
|
||||
|
||||
normal! x
|
||||
if match(next_char, '\s') != -1
|
||||
@ -129,7 +134,10 @@ function! AutoPairsFastWrap()
|
||||
call search(close, 'W')
|
||||
return "\<RIGHT>".current_char."\<LEFT>"
|
||||
else
|
||||
execute "normal! ea".current_char
|
||||
if match(next_char, '\w') != -1
|
||||
execute "normal! he"
|
||||
end
|
||||
execute "normal! a".current_char
|
||||
return ""
|
||||
end
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user