mirror of
https://github.com/jiangmiao/auto-pairs.git
synced 2025-04-20 19:28:48 +08:00
Fix jump over closed pair
This commit is contained in:
commit
1ff8be79d3
11
README.md
11
README.md
@ -5,11 +5,12 @@ Insert or delete brackets, parens, quotes in pair.
|
||||
Installation
|
||||
------------
|
||||
|
||||
copy plugin/auto-pairs.vim to ~/.vim/plugin
|
||||
|
||||
or if you are using `pathogen`:
|
||||
|
||||
```git clone git://github.com/jiangmiao/auto-pairs.git ~/.vim/bundle/auto-pairs```
|
||||
* Manual
|
||||
* Copy `plugin/auto-pairs.vim` to `~/.vim/plugin`
|
||||
* [Pathogen](https://github.com/tpope/vim-pathogen)
|
||||
* `git clone git://github.com/jiangmiao/auto-pairs.git ~/.vim/bundle/auto-pairs`
|
||||
* [Vundle](https://github.com/VundleVim/Vundle.vim)
|
||||
* `Plugin 'jiangmiao/auto-pairs'`
|
||||
|
||||
Features
|
||||
--------
|
||||
|
@ -189,8 +189,13 @@ func! AutoPairsInsert(key)
|
||||
let m = s:matchbegin(after, '\v\s*\zs\V'.close)
|
||||
if len(m) > 0
|
||||
" skip close pair
|
||||
call search(m[1], 'We')
|
||||
return "\<Right>"
|
||||
let c = matchstr(after, '^\V'.close)
|
||||
if c != ""
|
||||
return s:right(c)
|
||||
else
|
||||
call search(m[1], 'We')
|
||||
return "\<Right>"
|
||||
end
|
||||
end
|
||||
end
|
||||
endfor
|
||||
@ -425,7 +430,7 @@ func! AutoPairsInit()
|
||||
end
|
||||
let c = close[0]
|
||||
call AutoPairsMap(o)
|
||||
if o != c && mapclose
|
||||
if o != c && c != '' && mapclose
|
||||
call AutoPairsMap(c)
|
||||
end
|
||||
let b:AutoPairsList += [[open, close]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user