diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-12-29 19:10:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-12-29 19:10:25 +0100 |
commit | 256972a9849b5d575b62a6a71be5b6934b5b0e8b (patch) | |
tree | dd9f8e5b91050090c005e8b81135e14af2a19e16 /runtime/plugin | |
parent | e292d80bede5cb0b9b1ca95176ad6c3fbaae2e0a (diff) | |
download | vim-git-256972a9849b5d575b62a6a71be5b6934b5b0e8b.tar.gz |
Updated runtime files.
Diffstat (limited to 'runtime/plugin')
-rw-r--r-- | runtime/plugin/matchparen.vim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 3804ab949..2a5a16a57 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -55,14 +55,19 @@ function! s:Highlight_Matching_Pair() let before = 0 let text = getline(c_lnum) - let c = text[c_col - 1] + let matches = matchlist(text, '\(.\)\=\%'.c_col.'c\(.\)') + if empty(matches) + let [c_before, c] = ['', ''] + else + let [c_before, c] = matches[1:2] + endif let plist = split(&matchpairs, '.\zs[:,]') let i = index(plist, c) if i < 0 " not found, in Insert mode try character before the cursor if c_col > 1 && (mode() == 'i' || mode() == 'R') - let before = 1 - let c = text[c_col - 2] + let before = strlen(c_before) + let c = c_before let i = index(plist, c) endif if i < 0 |