Update runtime files. Make matchparen plugin backwards compatible.

Add json filetype.
This commit is contained in:
Bram Moolenaar
2014-07-19 14:04:47 +02:00
parent a04854932e
commit 07d87790f1
12 changed files with 133 additions and 24 deletions

View File

@ -1,6 +1,6 @@
" Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Jul 09
" Last Change: 2014 Jul 19
" Exit quickly when:
" - this plugin was already loaded (or disabled)
@ -88,7 +88,13 @@ function! s:Highlight_Matching_Pair()
" Find the match. When it was just before the cursor move it there for a
" moment.
if before > 0
let save_cursor = getcurpos()
let has_getcurpos = exists("*getcurpos")
if has_getcurpos
" getcurpos() is more efficient but doesn't exist before 7.4.313.
let save_cursor = getcurpos()
else
let save_cursor = winsaveview()
endif
call cursor(c_lnum, c_col - before)
endif
@ -148,7 +154,11 @@ function! s:Highlight_Matching_Pair()
endtry
if before > 0
call setpos('.', save_cursor)
if has_getcurpos
call setpos('.', save_cursor)
else
call winrestview(save_cursor)
endif
endif
" If a match is found setup match highlighting.