Mercurial > vim
comparison runtime/plugin/matchparen.vim @ 31271:985a3d6e1d4b v9.0.0969
patch 9.0.0969: matchparen highlight is not updated when switching buffers
Commit: https://github.com/vim/vim/commit/28a896f54d4b2f2b4bef8ef4144dde1673c9d6e7
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 28 22:21:12 2022 +0000
patch 9.0.0969: matchparen highlight is not updated when switching buffers
Problem: Matchparen highlight is not updated when switching buffers.
Solution: Listen to the BufLeave and the BufWinEnter autocmd events.
(closes #11626)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 28 Nov 2022 23:30:03 +0100 |
parents | b15334beeaa4 |
children | 15c80d8bc515 |
comparison
equal
deleted
inserted
replaced
31270:8f50da4cfb18 | 31271:985a3d6e1d4b |
---|---|
1 " Vim plugin for showing matching parens | 1 " Vim plugin for showing matching parens |
2 " Maintainer: Bram Moolenaar <Bram@vim.org> | 2 " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 " Last Change: 2021 Apr 08 | 3 " Last Change: 2022 Nov 28 |
4 | 4 |
5 " Exit quickly when: | 5 " Exit quickly when: |
6 " - this plugin was already loaded (or disabled) | 6 " - this plugin was already loaded (or disabled) |
7 " - when 'compatible' is set | 7 " - when 'compatible' is set |
8 if exists("g:loaded_matchparen") || &cp | 8 if exists("g:loaded_matchparen") || &cp |
17 let g:matchparen_insert_timeout = 60 | 17 let g:matchparen_insert_timeout = 60 |
18 endif | 18 endif |
19 | 19 |
20 augroup matchparen | 20 augroup matchparen |
21 " Replace all matchparen autocommands | 21 " Replace all matchparen autocommands |
22 autocmd! CursorMoved,CursorMovedI,WinEnter,WinScrolled * call s:Highlight_Matching_Pair() | 22 autocmd! CursorMoved,CursorMovedI,WinEnter,BufWinEnter,WinScrolled * call s:Highlight_Matching_Pair() |
23 autocmd! WinLeave * call s:Remove_Matches() | 23 autocmd! WinLeave,BufLeave * call s:Remove_Matches() |
24 if exists('##TextChanged') | 24 if exists('##TextChanged') |
25 autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair() | 25 autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair() |
26 endif | 26 endif |
27 augroup END | 27 augroup END |
28 | 28 |