diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-29 10:17:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-29 10:17:57 +0800 |
commit | 65e8ed45de98bf93491c6740772f0a42834696ab (patch) | |
tree | e40c3905b1cc11ab5dee914ecc31916fb7967596 /test/functional/legacy/display_spec.lua | |
parent | 615f124003376c007442319b31a172360796974c (diff) | |
download | rneovim-65e8ed45de98bf93491c6740772f0a42834696ab.tar.gz rneovim-65e8ed45de98bf93491c6740772f0a42834696ab.tar.bz2 rneovim-65e8ed45de98bf93491c6740772f0a42834696ab.zip |
vim-patch:9.0.0969: matchparen highlight is not updated when switching buffers (#21227)
Problem: Matchparen highlight is not updated when switching buffers.
Solution: Listen to the BufLeave and the BufWinEnter autocmd events.
(closes vim/vim#11626)
https://github.com/vim/vim/commit/28a896f54d4b2f2b4bef8ef4144dde1673c9d6e7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/functional/legacy/display_spec.lua')
-rw-r--r-- | test/functional/legacy/display_spec.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/functional/legacy/display_spec.lua b/test/functional/legacy/display_spec.lua index 9160129a02..f9b78f5dcd 100644 --- a/test/functional/legacy/display_spec.lua +++ b/test/functional/legacy/display_spec.lua @@ -58,6 +58,51 @@ describe('display', function() ]]) end) + -- oldtest: Test_matchparen_clear_highlight() + it('matchparen highlight is cleared when switching buffer', function() + local screen = Screen.new(20, 5) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, + [1] = {background = Screen.colors.Cyan}, + }) + screen:attach() + + local screen1 = [[ + {1:^()} | + {0:~ }| + {0:~ }| + {0:~ }| + | + ]] + local screen2 = [[ + ^aa | + {0:~ }| + {0:~ }| + {0:~ }| + | + ]] + + exec([[ + source $VIMRUNTIME/plugin/matchparen.vim + set hidden + call setline(1, ['()']) + normal 0 + ]]) + screen:expect(screen1) + + exec([[ + enew + exe "normal iaa\<Esc>0" + ]]) + screen:expect(screen2) + + feed('<C-^>') + screen:expect(screen1) + + feed('<C-^>') + screen:expect(screen2) + end) + local function run_test_display_lastline(euro) local screen = Screen.new(75, 10) screen:set_default_attr_ids({ |