annotate src/testdir/test_matchparen.vim @ 35466:9982c22412af v9.1.0502

patch 9.1.0502: MS-Windows: too much legacy code Commit: https://github.com/vim/vim/commit/56f587b3f81f403bb0546c6892b3273b2a9e954f Author: K.Takata <kentkt@csc.jp> Date: Wed Jun 19 19:56:03 2024 +0200 patch 9.1.0502: MS-Windows: too much legacy code Problem: MS-Windows: too much legacy code Solution: Clean up old code (Ken Takata) * Remove very old codes for Cygwin version of GCC. Nowadays Cygwin GCC cannot be used for building Win32 Vim. (The `-mno-cygwin` option was removed in Cygwin GCC4.) * Remove old codes for old versions of MinGW. Remove `__MINGW32__` as much as possible. * Adjust makefile. closes: #15044 Signed-off-by: K.Takata <kentkt@csc.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 19 Jun 2024 20:00:09 +0200
parents 2ee041017eb4
children 1cd9db1c8bbd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33762
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for the matchparen plugin
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 if !has('gui_running') && has('unix')
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 set term=ansi
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 endif
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 source view_util.vim
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 source check.vim
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 source screendump.vim
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 " Test for scrolling that modifies buffer during visual block
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 func Test_visual_block_scroll()
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 CheckScreendump
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 let lines =<< trim END
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 source $VIMRUNTIME/plugin/matchparen.vim
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 set scrolloff=1
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call setline(1, ['a', 'b', 'c', 'd', 'e', '', '{', '}', '{', 'f', 'g', '}'])
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call cursor(5, 1)
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 END
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 let filename = 'Xvisualblockmodifiedscroll'
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 call writefile(lines, filename, 'D')
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 let buf = RunVimInTerminal('-S '.filename, #{rows: 7})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call term_sendkeys(buf, "V\<C-D>\<C-D>")
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 call VerifyScreenDump(buf, 'Test_display_visual_block_scroll', {})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call StopVimInTerminal(buf)
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 endfunc
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 " Test for clearing paren highlight when switching buffers
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 func Test_matchparen_clear_highlight()
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 CheckScreendump
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 let lines =<< trim END
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 source $VIMRUNTIME/plugin/matchparen.vim
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 set hidden
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 call setline(1, ['()'])
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 normal 0
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 func OtherBuffer()
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 enew
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 exe "normal iaa\<Esc>0"
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 endfunc
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 END
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 call writefile(lines, 'XMatchparenClear', 'D')
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 let buf = RunVimInTerminal('-S XMatchparenClear', #{rows: 5})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_1', {})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 call term_sendkeys(buf, ":call OtherBuffer()\<CR>:\<Esc>")
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_2', {})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 call term_sendkeys(buf, "\<C-^>:\<Esc>")
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_1', {})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 call term_sendkeys(buf, "\<C-^>:\<Esc>")
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 call VerifyScreenDump(buf, 'Test_matchparen_clear_highlight_2', {})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 call StopVimInTerminal(buf)
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 endfunc
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63
34529
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
64 " Test for matchparen highlight when switching buffer in win_execute()
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
65 func Test_matchparen_win_execute()
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
66 CheckScreendump
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
67
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
68 let lines =<< trim END
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
69 source $VIMRUNTIME/plugin/matchparen.vim
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
70 let s:win = win_getid()
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
71 call setline(1, '{}')
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
72 split
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
73
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
74 func SwitchBuf()
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
75 call win_execute(s:win, 'enew | buffer #')
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
76 endfunc
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
77 END
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
78 call writefile(lines, 'XMatchparenWinExecute', 'D')
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
79 let buf = RunVimInTerminal('-S XMatchparenWinExecute', #{rows: 5})
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
80 call VerifyScreenDump(buf, 'Test_matchparen_win_execute_1', {})
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
81
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
82 " Switching buffer away and back shouldn't change matchparen highlight.
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
83 call term_sendkeys(buf, ":call SwitchBuf()\<CR>:\<Esc>")
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
84 call VerifyScreenDump(buf, 'Test_matchparen_win_execute_1', {})
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
85
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
86 call StopVimInTerminal(buf)
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
87 endfunc
2ee041017eb4 patch 9.1.0167: Changing buffer in another window causes it to show matchparen
Christian Brabandt <cb@256bit.org>
parents: 33762
diff changeset
88
33762
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 " Test for scrolling that modifies buffer during visual block
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 func Test_matchparen_pum_clear()
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 CheckScreendump
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 let lines =<< trim END
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 source $VIMRUNTIME/plugin/matchparen.vim
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 set completeopt=menuone
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 call setline(1, ['aa', 'aaa', 'aaaa', '(a)'])
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 call cursor(4, 3)
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 END
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 let filename = 'Xmatchparen'
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 call writefile(lines, filename, 'D')
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 let buf = RunVimInTerminal('-S '.filename, #{rows: 10})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 call term_sendkeys(buf, "i\<C-N>\<C-N>")
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 call VerifyScreenDump(buf, 'Test_matchparen_pum_clear_1', {})
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 call StopVimInTerminal(buf)
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 endfunc
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111
7b26c36e9b3b patch 9.0.2102: matchparen highlight not cleared in completion mode
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 " vim: shiftwidth=2 sts=2 expandtab