diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-28 21:58:50 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-04-28 22:14:37 -0400 |
commit | 7c6ca6fed8bceed67315e046a33701d71ac4b436 (patch) | |
tree | f489cf6843f0f125e89d3f91cee2777156f0ef84 /runtime/plugin | |
parent | df2acdc3be807393ea8d61bb94c41d792388c0de (diff) | |
download | rneovim-7c6ca6fed8bceed67315e046a33701d71ac4b436.tar.gz rneovim-7c6ca6fed8bceed67315e046a33701d71ac4b436.tar.bz2 rneovim-7c6ca6fed8bceed67315e046a33701d71ac4b436.zip |
vim-patch:73fef33014db
Update runtime files
https://github.com/vim/vim/commit/73fef33014dbf21fc59e7e47fb091117868d82fb
Omit usr_46.txt.
Diffstat (limited to 'runtime/plugin')
-rw-r--r-- | runtime/plugin/matchparen.vim | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim index 59d33f4d4e..162430ecd0 100644 --- a/runtime/plugin/matchparen.vim +++ b/runtime/plugin/matchparen.vim @@ -1,6 +1,6 @@ " Vim plugin for showing matching parens " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2019 Oct 28 +" Last Change: 2020 Jun 18 " Exit quickly when: " - this plugin was already loaded (or disabled) @@ -21,6 +21,7 @@ endif augroup matchparen " Replace all matchparen autocommands autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair() + autocmd! WinLeave * call s:Remove_Matches() if exists('##TextChanged') autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair() endif @@ -38,10 +39,7 @@ set cpo-=C " for any matching paren. func s:Highlight_Matching_Pair() " Remove any previous match. - if exists('w:paren_hl_on') && w:paren_hl_on - silent! call matchdelete(3) - let w:paren_hl_on = 0 - endif + call s:Remove_Matches() " Avoid that we remove the popup menu. " Return when there are no colors (looks like the cursor jumps). @@ -195,6 +193,14 @@ func s:Highlight_Matching_Pair() endif endfunction +func s:Remove_Matches() + if exists('w:paren_hl_on') && w:paren_hl_on + silent! call matchdelete(3) + let w:paren_hl_on = 0 + endif +endfunc + + " Define commands that will disable and enable the plugin. command DoMatchParen call s:DoMatchParen() command NoMatchParen call s:NoMatchParen() |