Update runtime files. Make matchparen plugin backwards compatible.
Add json filetype.
This commit is contained in:
@ -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.
|
||||
|
||||
Reference in New Issue
Block a user