annotate src/testdir/test_quickfix.vim @ 28183:2b595cee4c85 v8.2.4617

patch 8.2.4617: no completion for :scriptnames Commit: https://github.com/vim/vim/commit/454ce6737cadb82886f1fc0eb9e8666cc59ae42b Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Mar 24 11:22:13 2022 +0000 patch 8.2.4617: no completion for :scriptnames Problem: No completion for :scriptnames. Solution: Implement :scriptnames completion. (Yegappan Lakshmanan, closes #10005)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Mar 2022 12:30:08 +0100
parents 2a2c0958a913
children 0e4097e7a714
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
1 " Test for the quickfix feature.
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
3 source check.vim
27457
4c16acb2525f patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 26618
diff changeset
4 import './vim9.vim' as v9
17089
8e9e9124c7a2 patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents: 17049
diff changeset
5 CheckFeature quickfix
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
18090
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
7 source screendump.vim
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
8
8649
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
9 set encoding=utf-8
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
10
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
11 func s:setup_commands(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
12 if a:cchar == 'c'
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
13 command! -nargs=* -bang Xlist <mods>clist<bang> <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
14 command! -nargs=* Xgetexpr <mods>cgetexpr <args>
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
15 command! -nargs=* Xaddexpr <mods>caddexpr <args>
12084
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
16 command! -nargs=* -count Xolder <mods><count>colder <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
17 command! -nargs=* Xnewer <mods>cnewer <args>
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
18 command! -nargs=* Xopen <mods> copen <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
19 command! -nargs=* Xwindow <mods>cwindow <args>
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
20 command! -nargs=* Xbottom <mods>cbottom <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
21 command! -nargs=* Xclose <mods>cclose <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
22 command! -nargs=* -bang Xfile <mods>cfile<bang> <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
23 command! -nargs=* Xgetfile <mods>cgetfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
24 command! -nargs=* Xaddfile <mods>caddfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
25 command! -nargs=* -bang Xbuffer <mods>cbuffer<bang> <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
26 command! -nargs=* Xgetbuffer <mods>cgetbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
27 command! -nargs=* Xaddbuffer <mods>caddbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
28 command! -nargs=* Xrewind <mods>crewind <args>
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
29 command! -count -nargs=* -bang Xnext <mods><count>cnext<bang> <args>
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
30 command! -count -nargs=* -bang Xprev <mods><count>cprev<bang> <args>
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
31 command! -nargs=* -bang Xfirst <mods>cfirst<bang> <args>
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
32 command! -nargs=* -bang Xlast <mods>clast<bang> <args>
16515
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
33 command! -count -nargs=* -bang Xnfile <mods><count>cnfile<bang> <args>
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
34 command! -nargs=* -bang Xpfile <mods>cpfile<bang> <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
35 command! -nargs=* Xexpr <mods>cexpr <args>
24547
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
36 command! -count=999 -nargs=* Xvimgrep <mods> <count>vimgrep <args>
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
37 command! -nargs=* Xvimgrepadd <mods> vimgrepadd <args>
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
38 command! -nargs=* Xgrep <mods> grep <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
39 command! -nargs=* Xgrepadd <mods> grepadd <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
40 command! -nargs=* Xhelpgrep helpgrep <args>
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
41 command! -nargs=0 -count Xcc <count>cc
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
42 command! -count=1 -nargs=0 Xbelow <mods><count>cbelow
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
43 command! -count=1 -nargs=0 Xabove <mods><count>cabove
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
44 command! -count=1 -nargs=0 Xbefore <mods><count>cbefore
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
45 command! -count=1 -nargs=0 Xafter <mods><count>cafter
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
46 let g:Xgetlist = function('getqflist')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
47 let g:Xsetlist = function('setqflist')
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
48 call setqflist([], 'f')
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
49 else
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
50 command! -nargs=* -bang Xlist <mods>llist<bang> <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
51 command! -nargs=* Xgetexpr <mods>lgetexpr <args>
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
52 command! -nargs=* Xaddexpr <mods>laddexpr <args>
12084
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
53 command! -nargs=* -count Xolder <mods><count>lolder <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
54 command! -nargs=* Xnewer <mods>lnewer <args>
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
55 command! -nargs=* Xopen <mods> lopen <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
56 command! -nargs=* Xwindow <mods>lwindow <args>
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
57 command! -nargs=* Xbottom <mods>lbottom <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
58 command! -nargs=* Xclose <mods>lclose <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
59 command! -nargs=* -bang Xfile <mods>lfile<bang> <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
60 command! -nargs=* Xgetfile <mods>lgetfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
61 command! -nargs=* Xaddfile <mods>laddfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
62 command! -nargs=* -bang Xbuffer <mods>lbuffer<bang> <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
63 command! -nargs=* Xgetbuffer <mods>lgetbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
64 command! -nargs=* Xaddbuffer <mods>laddbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
65 command! -nargs=* Xrewind <mods>lrewind <args>
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
66 command! -count -nargs=* -bang Xnext <mods><count>lnext<bang> <args>
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
67 command! -count -nargs=* -bang Xprev <mods><count>lprev<bang> <args>
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
68 command! -nargs=* -bang Xfirst <mods>lfirst<bang> <args>
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
69 command! -nargs=* -bang Xlast <mods>llast<bang> <args>
16515
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
70 command! -count -nargs=* -bang Xnfile <mods><count>lnfile<bang> <args>
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
71 command! -nargs=* -bang Xpfile <mods>lpfile<bang> <args>
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
72 command! -nargs=* Xexpr <mods>lexpr <args>
24547
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
73 command! -count=999 -nargs=* Xvimgrep <mods> <count>lvimgrep <args>
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
74 command! -nargs=* Xvimgrepadd <mods> lvimgrepadd <args>
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
75 command! -nargs=* Xgrep <mods> lgrep <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
76 command! -nargs=* Xgrepadd <mods> lgrepadd <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
77 command! -nargs=* Xhelpgrep lhelpgrep <args>
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
78 command! -nargs=0 -count Xcc <count>ll
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
79 command! -count=1 -nargs=0 Xbelow <mods><count>lbelow
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
80 command! -count=1 -nargs=0 Xabove <mods><count>labove
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
81 command! -count=1 -nargs=0 Xbefore <mods><count>lbefore
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
82 command! -count=1 -nargs=0 Xafter <mods><count>lafter
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
83 let g:Xgetlist = function('getloclist', [0])
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
84 let g:Xsetlist = function('setloclist', [0])
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
85 call setloclist(0, [], 'f')
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
86 endif
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
87 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
88
26568
c675779d5f2b patch 8.2.3813: confusing error when using :cc without error list
Bram Moolenaar <Bram@vim.org>
parents: 26526
diff changeset
89 " This must be run before any error lists are created.
c675779d5f2b patch 8.2.3813: confusing error when using :cc without error list
Bram Moolenaar <Bram@vim.org>
parents: 26526
diff changeset
90 func Test_AA_cc_no_errors()
c675779d5f2b patch 8.2.3813: confusing error when using :cc without error list
Bram Moolenaar <Bram@vim.org>
parents: 26526
diff changeset
91 call assert_fails('cc', 'E42:')
c675779d5f2b patch 8.2.3813: confusing error when using :cc without error list
Bram Moolenaar <Bram@vim.org>
parents: 26526
diff changeset
92 call assert_fails('ll', 'E42:')
c675779d5f2b patch 8.2.3813: confusing error when using :cc without error list
Bram Moolenaar <Bram@vim.org>
parents: 26526
diff changeset
93 endfunc
c675779d5f2b patch 8.2.3813: confusing error when using :cc without error list
Bram Moolenaar <Bram@vim.org>
parents: 26526
diff changeset
94
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 " Tests for the :clist and :llist commands
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
96 func XlistTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
97 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
99 if a:cchar == 'l'
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
100 call assert_fails('llist', 'E776:')
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
101 endif
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 " With an empty list, command should return error
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
103 Xgetexpr []
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
104 silent! Xlist
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 call assert_true(v:errmsg ==# 'E42: No Errors')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107 " Populate the list and then try
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
108 Xgetexpr ['non-error 1', 'Xtestfile1:1:3:Line1',
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 \ 'non-error 2', 'Xtestfile2:2:2:Line2',
18827
f98368dd6615 patch 8.1.2401: :cexpr does not handle | in expression
Bram Moolenaar <Bram@vim.org>
parents: 18740
diff changeset
110 \ 'non-error| 3', 'Xtestfile3:3:1:Line3']
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 " List only valid entries
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
113 let l = split(execute('Xlist', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 call assert_equal([' 2 Xtestfile1:1 col 3: Line1',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 \ ' 4 Xtestfile2:2 col 2: Line2',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
116 \ ' 6 Xtestfile3:3 col 1: Line3'], l)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
117
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
118 " List all the entries
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
119 let l = split(execute('Xlist!', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 call assert_equal([' 1: non-error 1', ' 2 Xtestfile1:1 col 3: Line1',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 \ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2',
18827
f98368dd6615 patch 8.1.2401: :cexpr does not handle | in expression
Bram Moolenaar <Bram@vim.org>
parents: 18740
diff changeset
122 \ ' 5: non-error| 3', ' 6 Xtestfile3:3 col 1: Line3'], l)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 " List a range of errors
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
125 let l = split(execute('Xlist 3,6', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 call assert_equal([' 4 Xtestfile2:2 col 2: Line2',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127 \ ' 6 Xtestfile3:3 col 1: Line3'], l)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
129 let l = split(execute('Xlist! 3,4', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 call assert_equal([' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2'], l)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
132 let l = split(execute('Xlist -6,-4', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 call assert_equal([' 2 Xtestfile1:1 col 3: Line1'], l)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
134
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
135 let l = split(execute('Xlist! -5,-3', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 call assert_equal([' 2 Xtestfile1:1 col 3: Line1',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137 \ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2'], l)
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
138
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
139 " Test for '+'
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
140 let l = split(execute('Xlist! +2', ''), "\n")
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
141 call assert_equal([' 2 Xtestfile1:1 col 3: Line1',
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
142 \ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2'], l)
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
143
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
144 " Ranged entries
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
145 call g:Xsetlist([{'lnum':10,'text':'Line1'},
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
146 \ {'lnum':20,'col':10,'text':'Line2'},
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
147 \ {'lnum':30,'col':15,'end_col':20,'text':'Line3'},
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
148 \ {'lnum':40,'end_lnum':45,'text':'Line4'},
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
149 \ {'lnum':50,'end_lnum':55,'col':15,'text':'Line5'},
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
150 \ {'lnum':60,'end_lnum':65,'col':25,'end_col':35,'text':'Line6'}])
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
151 let l = split(execute('Xlist', ""), "\n")
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
152 call assert_equal([' 1:10: Line1',
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
153 \ ' 2:20 col 10: Line2',
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
154 \ ' 3:30 col 15-20: Line3',
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
155 \ ' 4:40-45: Line4',
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
156 \ ' 5:50-55 col 15: Line5',
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
157 \ ' 6:60-65 col 25-35: Line6'], l)
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
158
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
159 " Different types of errors
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
160 call g:Xsetlist([{'lnum':10,'col':5,'type':'W', 'text':'Warning','nr':11},
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
161 \ {'lnum':20,'col':10,'type':'e','text':'Error','nr':22},
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
162 \ {'lnum':30,'col':15,'type':'i','text':'Info','nr':33},
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
163 \ {'lnum':40,'col':20,'type':'x', 'text':'Other','nr':44},
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
164 \ {'lnum':50,'col':25,'type':"\<C-A>",'text':'one','nr':55}])
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
165 let l = split(execute('Xlist', ""), "\n")
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
166 call assert_equal([' 1:10 col 5 warning 11: Warning',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
167 \ ' 2:20 col 10 error 22: Error',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
168 \ ' 3:30 col 15 info 33: Info',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
169 \ ' 4:40 col 20 x 44: Other',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
170 \ ' 5:50 col 25 55: one'], l)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
171
13821
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
172 " Test for module names, one needs to explicitly set `'valid':v:true` so
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
173 call g:Xsetlist([
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
174 \ {'lnum':10,'col':5,'type':'W','module':'Data.Text','text':'ModuleWarning','nr':11,'valid':v:true},
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
175 \ {'lnum':20,'col':10,'type':'W','module':'Data.Text','filename':'Data/Text.hs','text':'ModuleWarning','nr':22,'valid':v:true},
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
176 \ {'lnum':30,'col':15,'type':'W','filename':'Data/Text.hs','text':'FileWarning','nr':33,'valid':v:true}])
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
177 let l = split(execute('Xlist', ""), "\n")
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
178 call assert_equal([' 1 Data.Text:10 col 5 warning 11: ModuleWarning',
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
179 \ ' 2 Data.Text:20 col 10 warning 22: ModuleWarning',
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
180 \ ' 3 Data/Text.hs:30 col 15 warning 33: FileWarning'], l)
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
181
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
182 " For help entries in the quickfix list, only the filename without directory
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
183 " should be displayed
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
184 Xhelpgrep setqflist()
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
185 let l = split(execute('Xlist 1', ''), "\n")
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
186 call assert_match('^ 1 [^\\/]\{-}:', l[0])
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
187
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
188 " Error cases
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
189 call assert_fails('Xlist abc', 'E488:')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
190 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
191
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
192 func Test_clist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
193 call XlistTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
194 call XlistTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
195 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
196
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
197 " Tests for the :colder, :cnewer, :lolder and :lnewer commands
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
198 " Note that this test assumes that a quickfix/location list is
7540
b910bb01832a commit https://github.com/vim/vim/commit/cfc0a350a9fa04f1b0cfa1ba31fbd2847376513f
Christian Brabandt <cb@256bit.org>
parents: 7513
diff changeset
199 " already set by the caller.
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
200 func XageTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
201 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
202
16215
4202f556aefe patch 8.1.1112: duplicate code in quickfix file
Bram Moolenaar <Bram@vim.org>
parents: 16019
diff changeset
203 if a:cchar == 'l'
4202f556aefe patch 8.1.1112: duplicate code in quickfix file
Bram Moolenaar <Bram@vim.org>
parents: 16019
diff changeset
204 " No location list for the current window
4202f556aefe patch 8.1.1112: duplicate code in quickfix file
Bram Moolenaar <Bram@vim.org>
parents: 16019
diff changeset
205 call assert_fails('lolder', 'E776:')
4202f556aefe patch 8.1.1112: duplicate code in quickfix file
Bram Moolenaar <Bram@vim.org>
parents: 16019
diff changeset
206 call assert_fails('lnewer', 'E776:')
4202f556aefe patch 8.1.1112: duplicate code in quickfix file
Bram Moolenaar <Bram@vim.org>
parents: 16019
diff changeset
207 endif
4202f556aefe patch 8.1.1112: duplicate code in quickfix file
Bram Moolenaar <Bram@vim.org>
parents: 16019
diff changeset
208
12692
03a6aeea2096 patch 8.0.1224: still interference between test functions
Christian Brabandt <cb@256bit.org>
parents: 12465
diff changeset
209 let list = [{'bufnr': bufnr('%'), 'lnum': 1}]
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
210 call g:Xsetlist(list)
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
211
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
212 " Jumping to a non existent list should return error
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
213 silent! Xolder 99
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
214 call assert_true(v:errmsg ==# 'E380: At bottom of quickfix stack')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
215
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
216 silent! Xnewer 99
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
217 call assert_true(v:errmsg ==# 'E381: At top of quickfix stack')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
218
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
219 " Add three quickfix/location lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
220 Xgetexpr ['Xtestfile1:1:3:Line1']
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
221 Xgetexpr ['Xtestfile2:2:2:Line2']
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
222 Xgetexpr ['Xtestfile3:3:1:Line3']
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
223
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
224 " Go back two lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
225 Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
226 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
227 call assert_equal('Line2', l[0].text)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
228
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
229 " Go forward two lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
230 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
231 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
232 call assert_equal('Line3', l[0].text)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
233
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
234 " Test for the optional count argument
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
235 Xolder 2
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
236 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
237 call assert_equal('Line1', l[0].text)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
238
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
239 Xnewer 2
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
240 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
241 call assert_equal('Line3', l[0].text)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
242 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
243
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
244 func Test_cage()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
245 call XageTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
246 call XageTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
247 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
248
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
249 " Tests for the :cwindow, :lwindow :cclose, :lclose, :copen and :lopen
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
250 " commands
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
251 func XwindowTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
252 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
253
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
254 " Opening the location list window without any errors should fail
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
255 if a:cchar == 'l'
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
256 call assert_fails('lopen', 'E776:')
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
257 call assert_fails('lwindow', 'E776:')
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
258 endif
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
259
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
260 " Create a list with no valid entries
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
261 Xgetexpr ['non-error 1', 'non-error 2', 'non-error 3']
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
262
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
263 " Quickfix/Location window should not open with no valid errors
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
264 Xwindow
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
265 call assert_true(winnr('$') == 1)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
266
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
267 " Create a list with valid entries
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
268 Xgetexpr ['Xtestfile1:1:3:Line1', 'Xtestfile2:2:2:Line2',
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
269 \ 'Xtestfile3:3:1:Line3']
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
270
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
271 " Open the window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
272 Xwindow
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
273 call assert_true(winnr('$') == 2 && winnr() == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
274 \ getline('.') ==# 'Xtestfile1|1 col 3| Line1')
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
275 redraw!
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
276
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
277 " Close the window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
278 Xclose
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
279 call assert_true(winnr('$') == 1)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
280
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
281 " Create a list with no valid entries
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
282 Xgetexpr ['non-error 1', 'non-error 2', 'non-error 3']
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
283
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
284 " Open the window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
285 Xopen 5
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
286 call assert_true(winnr('$') == 2 && getline('.') ==# '|| non-error 1'
22083
c67a9d3b3683 patch 8.2.1591: using winheight('.') in tests works but is wrong
Bram Moolenaar <Bram@vim.org>
parents: 22015
diff changeset
287 \ && winheight(0) == 5)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
288
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
289 " Opening the window again, should move the cursor to that window
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
290 wincmd t
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
291 Xopen 7
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
292 call assert_true(winnr('$') == 2 && winnr() == 2 &&
22083
c67a9d3b3683 patch 8.2.1591: using winheight('.') in tests works but is wrong
Bram Moolenaar <Bram@vim.org>
parents: 22015
diff changeset
293 \ winheight(0) == 7 &&
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
294 \ getline('.') ==# '|| non-error 1')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
295
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
296 " :cnext in quickfix window should move to the next entry
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
297 Xnext
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
298 call assert_equal(2, g:Xgetlist({'idx' : 0}).idx)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
299
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
300 " Calling cwindow should close the quickfix window with no valid errors
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
301 Xwindow
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
302 call assert_true(winnr('$') == 1)
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
303
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
304 " Specifying the width should adjust the width for a vertically split
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
305 " quickfix window.
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
306 vert Xopen
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
307 call assert_equal(10, winwidth(0))
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
308 vert Xopen 12
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
309 call assert_equal(12, winwidth(0))
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
310 Xclose
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
311
21020
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
312 " Horizontally or vertically splitting the quickfix window should create a
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
313 " normal window/buffer
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
314 Xopen
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
315 wincmd s
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
316 call assert_equal(0, getwininfo(win_getid())[0].quickfix)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
317 call assert_equal(0, getwininfo(win_getid())[0].loclist)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
318 call assert_notequal('quickfix', &buftype)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
319 close
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
320 Xopen
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
321 wincmd v
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
322 call assert_equal(0, getwininfo(win_getid())[0].quickfix)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
323 call assert_equal(0, getwininfo(win_getid())[0].loclist)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
324 call assert_notequal('quickfix', &buftype)
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
325 close
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
326 Xopen
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
327 Xclose
6c634e63989c patch 8.2.1061: insufficient testing for src/window.c
Bram Moolenaar <Bram@vim.org>
parents: 20978
diff changeset
328
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
329 if a:cchar == 'c'
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
330 " Opening the quickfix window in multiple tab pages should reuse the
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
331 " quickfix buffer
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
332 Xgetexpr ['Xtestfile1:1:3:Line1', 'Xtestfile2:2:2:Line2',
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
333 \ 'Xtestfile3:3:1:Line3']
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
334 Xopen
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
335 let qfbufnum = bufnr('%')
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
336 tabnew
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
337 Xopen
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
338 call assert_equal(qfbufnum, bufnr('%'))
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
339 new | only | tabonly
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
340 endif
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
341 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
342
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
343 func Test_cwindow()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
344 call XwindowTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
345 call XwindowTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
346 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
347
16483
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
348 func Test_copenHeight()
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
349 copen
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
350 wincmd H
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
351 let height = winheight(0)
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
352 copen 10
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
353 call assert_equal(height, winheight(0))
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
354 quit
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
355 endfunc
393dd420a753 patch 8.1.1245: ":copen 10" sets height in full-height window
Bram Moolenaar <Bram@vim.org>
parents: 16259
diff changeset
356
18319
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
357 func Test_copenHeight_tabline()
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
358 set tabline=foo showtabline=2
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
359 copen
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
360 wincmd H
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
361 let height = winheight(0)
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
362 copen 10
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
363 call assert_equal(height, winheight(0))
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
364 quit
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
365 set tabline& showtabline&
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
366 endfunc
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
367
4cc8a1a134fc patch 8.1.2154: quickfix window height wrong when there is a tabline
Bram Moolenaar <Bram@vim.org>
parents: 18090
diff changeset
368
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
369 " Tests for the :cfile, :lfile, :caddfile, :laddfile, :cgetfile and :lgetfile
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
370 " commands.
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
371 func XfileTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
372 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
373
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
374 call writefile(['Xtestfile1:700:10:Line 700',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
375 \ 'Xtestfile2:800:15:Line 800'], 'Xqftestfile1')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
376
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
377 enew!
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
378 Xfile Xqftestfile1
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
379 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
380 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
381 \ l[0].lnum == 700 && l[0].col == 10 && l[0].text ==# 'Line 700' &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
382 \ l[1].lnum == 800 && l[1].col == 15 && l[1].text ==# 'Line 800')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
383
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
384 " Test with a non existent file
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
385 call assert_fails('Xfile non_existent_file', 'E40:')
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
386
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
387 " Run cfile/lfile from a modified buffer
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
388 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
389 silent! put ='Quickfix'
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
390 silent! Xfile Xqftestfile1
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
391 call assert_true(v:errmsg ==# 'E37: No write since last change (add ! to override)')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
392
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
393 call writefile(['Xtestfile3:900:30:Line 900'], 'Xqftestfile1')
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
394 Xaddfile Xqftestfile1
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
395 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
396 call assert_true(len(l) == 3 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
397 \ l[2].lnum == 900 && l[2].col == 30 && l[2].text ==# 'Line 900')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
398
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
399 call writefile(['Xtestfile1:222:77:Line 222',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
400 \ 'Xtestfile2:333:88:Line 333'], 'Xqftestfile1')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
401
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
402 enew!
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
403 Xgetfile Xqftestfile1
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
404 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
405 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
406 \ l[0].lnum == 222 && l[0].col == 77 && l[0].text ==# 'Line 222' &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
407 \ l[1].lnum == 333 && l[1].col == 88 && l[1].text ==# 'Line 333')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
408
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
409 " Test for a file with a long line and without a newline at the end
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
410 let text = repeat('x', 1024)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
411 let t = 'a.txt:18:' . text
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
412 call writefile([t], 'Xqftestfile1', 'b')
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
413 silent! Xfile Xqftestfile1
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
414 call assert_equal(text, g:Xgetlist()[0].text)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
415
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
416 call delete('Xqftestfile1')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
417 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
418
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
419 func Test_cfile()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
420 call XfileTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
421 call XfileTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
422 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
423
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
424 " Tests for the :cbuffer, :lbuffer, :caddbuffer, :laddbuffer, :cgetbuffer and
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
425 " :lgetbuffer commands.
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
426 func XbufferTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
427 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
428
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
429 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
430 silent! call setline(1, ['Xtestfile7:700:10:Line 700',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
431 \ 'Xtestfile8:800:15:Line 800'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
432 Xbuffer!
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
433 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
434 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
435 \ l[0].lnum == 700 && l[0].col == 10 && l[0].text ==# 'Line 700' &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
436 \ l[1].lnum == 800 && l[1].col == 15 && l[1].text ==# 'Line 800')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
437
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
438 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
439 silent! call setline(1, ['Xtestfile9:900:55:Line 900',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
440 \ 'Xtestfile10:950:66:Line 950'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
441 Xgetbuffer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
442 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
443 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
444 \ l[0].lnum == 900 && l[0].col == 55 && l[0].text ==# 'Line 900' &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
445 \ l[1].lnum == 950 && l[1].col == 66 && l[1].text ==# 'Line 950')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
446
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
447 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
448 silent! call setline(1, ['Xtestfile11:700:20:Line 700',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
449 \ 'Xtestfile12:750:25:Line 750'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
450 Xaddbuffer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
451 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
452 call assert_true(len(l) == 4 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
453 \ l[1].lnum == 950 && l[1].col == 66 && l[1].text ==# 'Line 950' &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
454 \ l[2].lnum == 700 && l[2].col == 20 && l[2].text ==# 'Line 700' &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
455 \ l[3].lnum == 750 && l[3].col == 25 && l[3].text ==# 'Line 750')
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
456 enew!
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
457
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
458 " Check for invalid buffer
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
459 call assert_fails('Xbuffer 199', 'E474:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
460
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
461 " Check for unloaded buffer
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
462 edit Xtestfile1
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
463 let bnr = bufnr('%')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
464 enew!
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
465 call assert_fails('Xbuffer ' . bnr, 'E681:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
466
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
467 " Check for invalid range
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
468 " Using Xbuffer will not run the range check in the cbuffer/lbuffer
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
469 " commands. So directly call the commands.
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
470 if (a:cchar == 'c')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
471 call assert_fails('900,999cbuffer', 'E16:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
472 else
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
473 call assert_fails('900,999lbuffer', 'E16:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
474 endif
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
475 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
476
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
477 func Test_cbuffer()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
478 call XbufferTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
479 call XbufferTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
480 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
481
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
482 func XexprTests(cchar)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
483 call s:setup_commands(a:cchar)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
484
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
485 call assert_fails('Xexpr 10', 'E777:')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
486 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
487
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
488 func Test_cexpr()
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
489 call XexprTests('c')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
490 call XexprTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
491 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
492
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
493 " Tests for :cnext, :cprev, :cfirst, :clast commands
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
494 func Xtest_browse(cchar)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
495 call s:setup_commands(a:cchar)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
496
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
497 call g:Xsetlist([], 'f')
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
498 " Jumping to first or next location list entry without any error should
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
499 " result in failure
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
500 if a:cchar == 'c'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
501 let err = 'E42:'
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
502 let cmd = '$cc'
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
503 else
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
504 let err = 'E776:'
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
505 let cmd = '$ll'
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
506 endif
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
507 call assert_fails('Xnext', err)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
508 call assert_fails('Xprev', err)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
509 call assert_fails('Xnfile', err)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
510 call assert_fails('Xpfile', err)
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
511 call assert_fails(cmd, err)
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
512
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
513 Xexpr ''
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
514 call assert_fails(cmd, 'E42:')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
515
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
516 call s:create_test_file('Xqftestfile1')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
517 call s:create_test_file('Xqftestfile2')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
518
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
519 Xgetexpr ['Xqftestfile1:5:Line5',
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
520 \ 'Xqftestfile1:6:Line6',
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
521 \ 'Xqftestfile2:10:Line10',
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
522 \ 'Xqftestfile2:11:Line11',
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
523 \ 'RegularLine1',
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
524 \ 'RegularLine2']
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
525
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
526 Xfirst
19471
cb73f4ae6b7c patch 8.2.0293: various Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 19435
diff changeset
527 call assert_fails('-5Xcc', 'E16:')
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
528 call assert_fails('Xprev', 'E553:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
529 call assert_fails('Xpfile', 'E553:')
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
530 Xnfile
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
531 call assert_equal('Xqftestfile2', @%)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
532 call assert_equal(10, line('.'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
533 Xpfile
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
534 call assert_equal('Xqftestfile1', @%)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
535 call assert_equal(6, line('.'))
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
536 5Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
537 call assert_equal(5, g:Xgetlist({'idx':0}).idx)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
538 2Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
539 call assert_equal(2, g:Xgetlist({'idx':0}).idx)
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
540 if a:cchar == 'c'
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
541 cc
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
542 else
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
543 ll
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
544 endif
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
545 call assert_equal(2, g:Xgetlist({'idx':0}).idx)
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
546 10Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
547 call assert_equal(6, g:Xgetlist({'idx':0}).idx)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
548 Xlast
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
549 Xprev
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
550 call assert_equal('Xqftestfile2', @%)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
551 call assert_equal(11, line('.'))
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
552 call assert_fails('Xnext', 'E553:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
553 call assert_fails('Xnfile', 'E553:')
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
554 " To process the range using quickfix list entries, directly use the
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
555 " quickfix commands (don't use the user defined commands)
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
556 if a:cchar == 'c'
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
557 $cc
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
558 else
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
559 $ll
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
560 endif
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
561 call assert_equal(6, g:Xgetlist({'idx':0}).idx)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
562 Xrewind
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
563 call assert_equal('Xqftestfile1', @%)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
564 call assert_equal(5, line('.'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
565
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
566 10Xnext
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
567 call assert_equal('Xqftestfile2', @%)
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
568 call assert_equal(11, line('.'))
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
569 10Xprev
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
570 call assert_equal('Xqftestfile1', @%)
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
571 call assert_equal(5, line('.'))
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
572
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
573 " Jumping to an error from the error window using cc command
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
574 Xgetexpr ['Xqftestfile1:5:Line5',
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
575 \ 'Xqftestfile1:6:Line6',
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
576 \ 'Xqftestfile2:10:Line10',
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
577 \ 'Xqftestfile2:11:Line11']
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
578 Xopen
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
579 10Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
580 call assert_equal(11, line('.'))
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
581 call assert_equal('Xqftestfile2', @%)
19407
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
582 Xopen
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
583 call cursor(2, 1)
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
584 if a:cchar == 'c'
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
585 .cc
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
586 else
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
587 .ll
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
588 endif
2f4be7ca1b1b patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19370
diff changeset
589 call assert_equal(6, line('.'))
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
590 call assert_equal('Xqftestfile1', @%)
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
591
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
592 " Jumping to an error from the error window (when only the error window is
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
593 " present)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
594 Xopen | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
595 Xlast 1
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
596 call assert_equal(5, line('.'))
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
597 call assert_equal('Xqftestfile1', @%)
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
598
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
599 Xexpr ""
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
600 call assert_fails('Xnext', 'E42:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
601
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
602 call delete('Xqftestfile1')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
603 call delete('Xqftestfile2')
12465
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
604
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
605 " Should be able to use next/prev with invalid entries
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
606 Xexpr ""
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
607 call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
608 call assert_equal(0, g:Xgetlist({'size' : 0}).size)
18827
f98368dd6615 patch 8.1.2401: :cexpr does not handle | in expression
Bram Moolenaar <Bram@vim.org>
parents: 18740
diff changeset
609 Xaddexpr ['foo', 'bar', 'baz', 'quux', 'sh|moo']
12465
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
610 call assert_equal(5, g:Xgetlist({'size' : 0}).size)
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
611 Xlast
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
612 call assert_equal(5, g:Xgetlist({'idx' : 0}).idx)
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
613 Xfirst
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
614 call assert_equal(1, g:Xgetlist({'idx' : 0}).idx)
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
615 2Xnext
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
616 call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
617 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
618
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
619 func Test_browse()
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
620 call Xtest_browse('c')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
621 call Xtest_browse('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
622 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
623
27897
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
624 " Test for memory allocation failures
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
625 func Xnomem_tests(cchar)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
626 call s:setup_commands(a:cchar)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
627
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
628 call test_alloc_fail(GetAllocId('qf_dirname_start'), 0, 0)
27897
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
629 call assert_fails('Xvimgrep vim runtest.vim', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
630
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
631 call test_alloc_fail(GetAllocId('qf_dirname_now'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
632 call assert_fails('Xvimgrep vim runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
633
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
634 call test_alloc_fail(GetAllocId('qf_namebuf'), 0, 0)
27897
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
635 call assert_fails('Xfile runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
636
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
637 call test_alloc_fail(GetAllocId('qf_errmsg'), 0, 0)
27897
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
638 call assert_fails('Xfile runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
639
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
640 call test_alloc_fail(GetAllocId('qf_pattern'), 0, 0)
27897
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
641 call assert_fails('Xfile runtest.vim', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
642
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
643 call test_alloc_fail(GetAllocId('qf_efm_fmtstr'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
644 set efm=%f
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
645 call assert_fails('Xexpr ["Xfile1"]', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
646 set efm&
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
647
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
648 call test_alloc_fail(GetAllocId('qf_efm_fmtpart'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
649 set efm=%f:%l:%m,%f-%l-%m
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
650 call assert_fails('Xaddexpr ["Xfile2", "Xfile3"]', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
651 set efm&
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
652
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
653 call test_alloc_fail(GetAllocId('qf_title'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
654 call assert_fails('Xexpr ""', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
655 call assert_equal('', g:Xgetlist({'all': 1}).title)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
656
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
657 call test_alloc_fail(GetAllocId('qf_mef_name'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
658 set makeef=Xtmp##.err
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
659 call assert_fails('Xgrep needle haystack', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
660 set makeef&
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
661
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
662 call test_alloc_fail(GetAllocId('qf_qfline'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
663 call assert_fails('Xexpr "Xfile1:10:Line10"', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
664
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
665 if a:cchar == 'l'
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
666 for id in ['qf_qfline', 'qf_qfinfo']
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
667 lgetexpr ["Xfile1:10:L10", "Xfile2:20:L20"]
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
668 call test_alloc_fail(GetAllocId(id), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
669 call assert_fails('new', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
670 call assert_equal(2, winnr('$'))
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
671 call assert_equal([], getloclist(0))
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
672 %bw!
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
673 endfor
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
674 endif
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
675
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
676 call test_alloc_fail(GetAllocId('qf_qfline'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
677 try
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
678 call assert_fails('Xvimgrep vim runtest.vim', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
679 catch /^Vim:Interrupt$/
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
680 endtry
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
681
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
682 call test_alloc_fail(GetAllocId('qf_qfline'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
683 try
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
684 call assert_fails('Xvimgrep /vim/f runtest.vim', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
685 catch /^Vim:Interrupt$/
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
686 endtry
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
687
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
688 let l = getqflist({"lines": ["Xfile1:10:L10"]})
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
689 call test_alloc_fail(GetAllocId('qf_qfline'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
690 call assert_fails('call g:Xsetlist(l.items)', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
691
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
692 call test_alloc_fail(GetAllocId('qf_qfline'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
693 try
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
694 call assert_fails('Xhelpgrep quickfix', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
695 catch /^Vim:Interrupt$/
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
696 endtry
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
697
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
698 call test_alloc_fail(GetAllocId('qf_qfinfo'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
699 call assert_fails('let l = g:Xgetlist({"lines": ["Xfile1:10:L10"]})', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
700 call assert_equal(#{items: []}, l)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
701
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
702 if a:cchar == 'l'
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
703 call setqflist([], 'f')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
704 call setloclist(0, [], 'f')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
705 call test_alloc_fail(GetAllocId('qf_qfinfo'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
706 call assert_fails('lhelpgrep quickfix', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
707 call assert_equal([], getloclist(0))
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
708
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
709 call test_alloc_fail(GetAllocId('qf_qfinfo'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
710 call assert_fails('lvimgrep vim runtest.vim', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
711
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
712 let l = getqflist({"lines": ["Xfile1:10:L10"]})
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
713 call test_alloc_fail(GetAllocId('qf_qfinfo'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
714 call assert_fails('call setloclist(0, l.items)', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
715
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
716 call test_alloc_fail(GetAllocId('qf_qfinfo'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
717 call assert_fails('lbuffer', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
718
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
719 call test_alloc_fail(GetAllocId('qf_qfinfo'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
720 call assert_fails('lexpr ["Xfile1:10:L10", "Xfile2:20:L20"]', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
721
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
722 call test_alloc_fail(GetAllocId('qf_qfinfo'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
723 call assert_fails('lfile runtest.vim', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
724 endif
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
725
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
726 call test_alloc_fail(GetAllocId('qf_dirstack'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
727 set efm=%DEntering\ dir\ %f,%f:%l:%m
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
728 call assert_fails('Xexpr ["Entering dir abc", "abc.txt:1:Hello world"]', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
729 set efm&
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
730
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
731 call test_alloc_fail(GetAllocId('qf_dirstack'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
732 set efm=%+P[%f],(%l)%m
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
733 call assert_fails('Xexpr ["[runtest.vim]", "(1)Hello"]', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
734 set efm&
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
735
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
736 call test_alloc_fail(GetAllocId('qf_multiline_pfx'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
737 set efm=%EError,%Cline\ %l,%Z%m
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
738 call assert_fails('Xexpr ["Error", "line 1", "msg"]', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
739 set efm&
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
740
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
741 call test_alloc_fail(GetAllocId('qf_makecmd'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
742 call assert_fails('Xgrep vim runtest.vim', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
743
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
744 call test_alloc_fail(GetAllocId('qf_linebuf'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
745 call assert_fails('Xexpr repeat("a", 8192)', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
746
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
747 call test_alloc_fail(GetAllocId('qf_linebuf'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
748 call assert_fails('Xexpr [repeat("a", 8192)]', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
749
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
750 new
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
751 call setline(1, repeat('a', 8192))
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
752 call test_alloc_fail(GetAllocId('qf_linebuf'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
753 call assert_fails('Xbuffer', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
754 %bw!
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
755
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
756 call writefile([repeat('a', 8192)], 'Xtest')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
757 call test_alloc_fail(GetAllocId('qf_linebuf'), 0, 0)
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
758 call assert_fails('Xfile Xtest', 'E342:')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
759 call delete('Xtest')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
760 endfunc
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
761
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
762 func Test_nomem()
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
763 call Xnomem_tests('c')
2a2c0958a913 patch 8.2.4474: memory allocation failures not tested in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27873
diff changeset
764 call Xnomem_tests('l')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
765 endfunc
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
766
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
767 func s:test_xhelpgrep(cchar)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
768 call s:setup_commands(a:cchar)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
769 Xhelpgrep quickfix
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
770 Xopen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
771 if a:cchar == 'c'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
772 let title_text = ':helpgrep quickfix'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
773 else
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
774 let title_text = ':lhelpgrep quickfix'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
775 endif
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
776 call assert_true(w:quickfix_title =~ title_text, w:quickfix_title)
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
777
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
778 " Jumping to a help topic should open the help window
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
779 only
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
780 Xnext
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
781 call assert_true(&buftype == 'help')
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
782 call assert_true(winnr('$') == 2)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
783 " Jumping to the next match should reuse the help window
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
784 Xnext
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
785 call assert_true(&buftype == 'help')
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
786 call assert_true(winnr() == 1)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
787 call assert_true(winnr('$') == 2)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
788 " Jumping to the next match from the quickfix window should reuse the help
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
789 " window
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
790 Xopen
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
791 Xnext
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
792 call assert_true(&buftype == 'help')
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
793 call assert_true(winnr() == 1)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
794 call assert_true(winnr('$') == 2)
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
795 call assert_match('|\d\+ col \d\+-\d\+|', getbufline(winbufnr(2), 1)[0])
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
796
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
797 " This wipes out the buffer, make sure that doesn't cause trouble.
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
798 Xclose
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
799
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
800 " When the current window is vertically split, jumping to a help match
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
801 " should open the help window at the top.
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
802 only | enew
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
803 let w1 = win_getid()
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
804 vert new
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
805 let w2 = win_getid()
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
806 Xnext
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
807 let w3 = win_getid()
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
808 call assert_true(&buftype == 'help')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
809 call assert_true(winnr() == 1)
18697
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
810 " See jump_to_help_window() for details
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
811 let w2_width = winwidth(w2)
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
812 if w2_width != &columns && w2_width < 80
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
813 call assert_equal(['col', [['leaf', w3],
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
814 \ ['row', [['leaf', w2], ['leaf', w1]]]]], winlayout())
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
815 else
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
816 call assert_equal(['row', [['col', [['leaf', w3], ['leaf', w2]]],
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
817 \ ['leaf', w1]]] , winlayout())
c035b4fa4bc5 patch 8.1.2340: quickfix test fails under valgrind and asan
Bram Moolenaar <Bram@vim.org>
parents: 18695
diff changeset
818 endif
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
819
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
820 new | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
821 set buftype=help
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
822 set modified
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
823 call assert_fails('Xnext', 'E37:')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
824 set nomodified
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
825 new | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
826
12427
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
827 if a:cchar == 'l'
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
828 " When a help window is present, running :lhelpgrep should reuse the
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
829 " help window and not the current window
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
830 new | only
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
831 call g:Xsetlist([], 'f')
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
832 help index.txt
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
833 wincmd w
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
834 lhelpgrep quickfix
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
835 call assert_equal(1, winnr())
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
836 call assert_notequal([], getloclist(1))
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
837 call assert_equal([], getloclist(2))
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
838 endif
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
839
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
840 new | only
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
841
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
842 " Search for non existing help string
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
843 call assert_fails('Xhelpgrep a1b2c3', 'E480:')
14915
f508bb2fb808 patch 8.1.0469: too often indexing in qf_lists[]
Bram Moolenaar <Bram@vim.org>
parents: 14664
diff changeset
844 " Invalid regular expression
21265
6a4806e326dd patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents: 21100
diff changeset
845 call assert_fails('Xhelpgrep \@<!', 'E866:')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
846 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
847
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
848 func Test_helpgrep()
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
849 call s:test_xhelpgrep('c')
9752
429be545637a commit https://github.com/vim/vim/commit/cf25fdb8f10a92b3bf9e295c466c1b69812b7886
Christian Brabandt <cb@256bit.org>
parents: 9608
diff changeset
850 helpclose
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
851 call s:test_xhelpgrep('l')
7677
85a7a945fb87 commit https://github.com/vim/vim/commit/62ef797496c6243d111c596a592a8ef8c1d1e710
Christian Brabandt <cb@256bit.org>
parents: 7593
diff changeset
852 endfunc
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
853
23493
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
854 def Test_helpgrep_vim9_restore_cpo()
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
855 assert_equal('aABceFs', &cpo)
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
856
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
857 var rtp_save = &rtp
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
858 var dir = 'Xruntime/after'
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
859 &rtp ..= ',' .. dir
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
860 mkdir(dir .. '/ftplugin', 'p')
23938
2a885d095bff patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Bram Moolenaar <Bram@vim.org>
parents: 23778
diff changeset
861 writefile(['vim9script'], dir .. '/ftplugin/qf.vim')
23493
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
862 filetype plugin on
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
863 silent helpgrep grail
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
864 cwindow
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
865 silent helpgrep grail
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
866
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
867 assert_equal('aABceFs', &cpo)
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
868 delete('Xruntime', 'rf')
23493
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
869 &rtp = rtp_save
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
870 cclose
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
871 helpclose
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
872 enddef
f8382c4e6551 patch 8.2.2289: Vim9: 'cpo' can become empty
Bram Moolenaar <Bram@vim.org>
parents: 23203
diff changeset
873
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
874 " When running the :helpgrep command, if an autocmd modifies the 'cpoptions'
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
875 " value, then Vim crashes. (issue fixed by 7.2b-004 and 8.2.4453)
27855
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
876 func Test_helpgrep_restore_cpo_aucmd()
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
877 let save_cpo = &cpo
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
878 augroup QF_Test
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
879 au!
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
880 autocmd BufNew * set cpo=acd
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
881 augroup END
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
882
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
883 helpgrep quickfix
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
884 call assert_equal('acd', &cpo)
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
885 %bw!
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
886
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
887 set cpo&vim
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
888 augroup QF_Test
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
889 au!
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
890 autocmd BufReadPost * set cpo=
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
891 augroup END
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
892
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
893 helpgrep buffer
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
894 call assert_equal('', &cpo)
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
895
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
896 augroup QF_Test
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
897 au!
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
898 augroup END
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
899 %bw!
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
900 let &cpo = save_cpo
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
901 endfunc
44a552776007 patch 8.2.4453: :helpgrep may free an option that was not allocated
Bram Moolenaar <Bram@vim.org>
parents: 27605
diff changeset
902
24590
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
903 def Test_vim9_cexpr()
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
904 var text = 'somefile:95:error'
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
905 cexpr text
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
906 var l = getqflist()
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
907 assert_equal(1, l->len())
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
908 assert_equal(95, l[0].lnum)
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
909 assert_equal('error', l[0].text)
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
910
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
911 text = 'somefile:77:warning'
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
912 caddexpr text
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
913 l = getqflist()
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
914 assert_equal(2, l->len())
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
915 assert_equal(77, l[1].lnum)
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
916 assert_equal('warning', l[1].text)
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
917 enddef
2818f846f099 patch 8.2.2834: Vim9: :cexpr does not work with local variables
Bram Moolenaar <Bram@vim.org>
parents: 24547
diff changeset
918
7710
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
919 func Test_errortitle()
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
920 augroup QfBufWinEnter
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
921 au!
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
922 au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE')
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
923 augroup END
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
924 copen
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
925 let a=[{'lnum': 308, 'bufnr': bufnr(''), 'col': 58, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': '', 'pattern': '', 'text': ' au BufWinEnter * :let g:a=get(w:, ''quickfix_title'', ''NONE'')'}]
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
926 call setqflist(a)
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
927 call assert_equal(':setqflist()', g:a)
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
928 augroup QfBufWinEnter
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
929 au!
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
930 augroup END
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
931 augroup! QfBufWinEnter
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
932 endfunc
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
933
8603
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
934 func Test_vimgreptitle()
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
935 augroup QfBufWinEnter
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
936 au!
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
937 au BufWinEnter * :let g:a=get(w:, 'quickfix_title', 'NONE')
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
938 augroup END
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
939 try
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
940 vimgrep /pattern/j file
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
941 catch /E480/
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
942 endtry
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
943 copen
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
944 call assert_equal(': vimgrep /pattern/j file', g:a)
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
945 augroup QfBufWinEnter
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
946 au!
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
947 augroup END
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
948 augroup! QfBufWinEnter
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
949 endfunc
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
950
26026
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
951 func Test_bufwinenter_once()
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
952 augroup QfBufWinEnter
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
953 au!
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
954 au BufWinEnter * let g:got_afile ..= 'got ' .. expand('<afile>')
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
955 augroup END
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
956 let g:got_afile = ''
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
957 copen
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
958 call assert_equal('got quickfix', g:got_afile)
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
959
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
960 cclose
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
961 unlet g:got_afile
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
962 augroup QfBufWinEnter
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
963 au!
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
964 augroup END
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
965 augroup! QfBufWinEnter
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
966 endfunc
db9fdfb86679 patch 8.2.3547: opening the quickfix window triggers BufWinEnter twice
Bram Moolenaar <Bram@vim.org>
parents: 25435
diff changeset
967
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
968 func XqfTitleTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
969 call s:setup_commands(a:cchar)
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
970
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
971 Xgetexpr ['file:1:1:message']
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
972 let l = g:Xgetlist()
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
973 if a:cchar == 'c'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
974 call setqflist(l, 'r')
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
975 else
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
976 call setloclist(0, l, 'r')
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
977 endif
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
978
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
979 Xopen
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
980 if a:cchar == 'c'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
981 let title = ':setqflist()'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
982 else
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
983 let title = ':setloclist()'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
984 endif
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
985 call assert_equal(title, w:quickfix_title)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
986 Xclose
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
987 endfunc
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
988
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
989 " Tests for quickfix window's title
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
990 func Test_qf_title()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
991 call XqfTitleTests('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
992 call XqfTitleTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
993 endfunc
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
994
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
995 " Tests for 'errorformat'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
996 func Test_efm()
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
997 let save_efm = &efm
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
998 set efm=%EEEE%m,%WWWW%m,%+CCCC%.%#,%-GGGG%.%#
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
999 cgetexpr ['WWWW', 'EEEE', 'CCCC']
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1000 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1001 call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l)
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1002 cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC']
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1003 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1004 call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l)
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1005 cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY']
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1006 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]')))
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1007 call assert_equal("[['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]]", l)
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
1008 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1009 endfunc
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1010
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1011 " This will test for problems in quickfix:
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1012 " A. incorrectly copying location lists which caused the location list to show
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1013 " a different name than the file that was actually being displayed.
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1014 " B. not reusing the window for which the location list window is opened but
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1015 " instead creating new windows.
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1016 " C. make sure that the location list window is not reused instead of the
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1017 " window it belongs to.
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1018 "
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1019 " Set up the test environment:
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1020 func ReadTestProtocol(name)
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1021 let base = substitute(a:name, '\v^test://(.*)%(\.[^.]+)?', '\1', '')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1022 let word = substitute(base, '\v(.*)\..*', '\1', '')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1023
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1024 setl modifiable
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1025 setl noreadonly
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1026 setl noswapfile
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1027 setl bufhidden=delete
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1028 %del _
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1029 " For problem 2:
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1030 " 'buftype' has to be set to reproduce the constant opening of new windows
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1031 setl buftype=nofile
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1032
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1033 call setline(1, word)
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1034
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1035 setl nomodified
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1036 setl nomodifiable
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1037 setl readonly
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1038 exe 'doautocmd BufRead ' . substitute(a:name, '\v^test://(.*)', '\1', '')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1039 endfunc
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
1040
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1041 func Test_locationlist()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1042 enew
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1043
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1044 augroup testgroup
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1045 au!
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1046 autocmd BufReadCmd test://* call ReadTestProtocol(expand("<amatch>"))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1047 augroup END
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1048
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1049 let words = [ "foo", "bar", "baz", "quux", "shmoo", "spam", "eggs" ]
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1050
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1051 let qflist = []
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1052 for word in words
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1053 call add(qflist, {'filename': 'test://' . word . '.txt', 'text': 'file ' . word . '.txt', })
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1054 " NOTE: problem 1:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1055 " intentionally not setting 'lnum' so that the quickfix entries are not
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1056 " valid
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1057 eval qflist->setloclist(0, ' ')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1058 endfor
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1059
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1060 " Test A
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1061 lrewind
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1062 enew
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1063 lopen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1064 4lnext
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1065 vert split
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1066 wincmd L
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1067 lopen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1068 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1069 lnext
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1070 let fileName = expand("%")
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1071 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1072 let locationListFileName = substitute(getline(line('.')), '\([^|]*\)|.*', '\1', '')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1073 let fileName = substitute(fileName, '\\', '/', 'g')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1074 let locationListFileName = substitute(locationListFileName, '\\', '/', 'g')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1075 call assert_equal("test://bar.txt", fileName)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1076 call assert_equal("test://bar.txt", locationListFileName)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1077
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1078 wincmd n | only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1079
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1080 " Test B:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1081 lrewind
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1082 lopen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1083 2
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1084 exe "normal \<CR>"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1085 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1086 3
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1087 exe "normal \<CR>"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1088 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1089 4
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1090 exe "normal \<CR>"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1091 call assert_equal(2, winnr('$'))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1092 wincmd n | only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1093
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1094 " Test C:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1095 lrewind
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1096 lopen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1097 " Let's move the location list window to the top to check whether it (the
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1098 " first window found) will be reused when we try to open new windows:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1099 wincmd K
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1100 2
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1101 exe "normal \<CR>"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1102 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1103 3
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1104 exe "normal \<CR>"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1105 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1106 4
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1107 exe "normal \<CR>"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1108 1wincmd w
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1109 call assert_equal('quickfix', &buftype)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1110 2wincmd w
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1111 let bufferName = expand("%")
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1112 let bufferName = substitute(bufferName, '\\', '/', 'g')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1113 call assert_equal('test://quux.txt', bufferName)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1114
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1115 wincmd n | only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1116
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1117 augroup! testgroup
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1118 endfunc
8605
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
1119
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1120 func Test_locationlist_curwin_was_closed()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1121 augroup testgroup
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1122 au!
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1123 autocmd BufReadCmd test_curwin.txt call R(expand("<amatch>"))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1124 augroup END
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1125
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1126 func! R(n)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1127 quit
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1128 endfunc
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1129
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1130 new
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1131 let q = []
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1132 call add(q, {'filename': 'test_curwin.txt' })
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1133 call setloclist(0, q)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1134 call assert_fails('lrewind', 'E924:')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1135
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1136 augroup! testgroup
27507
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
1137 delfunc R
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1138 endfunc
8649
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
1139
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1140 func Test_locationlist_cross_tab_jump()
10281
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1141 call writefile(['loclistfoo'], 'loclistfoo')
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1142 call writefile(['loclistbar'], 'loclistbar')
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1143 set switchbuf=usetab
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1144
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1145 edit loclistfoo
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1146 tabedit loclistbar
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1147 silent lgrep loclistfoo loclist*
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1148 call assert_equal(1, tabpagenr())
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1149
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1150 enew | only | tabonly
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1151 set switchbuf&vim
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1152 call delete('loclistfoo')
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1153 call delete('loclistbar')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1154 endfunc
10281
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
1155
8649
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
1156 " More tests for 'errorformat'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1157 func Test_efm1()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1158 " The 'errorformat' setting is different on non-Unix systems.
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1159 " This test works only on Unix-like systems.
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1160 CheckUnix
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1161
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1162 let l =<< trim [DATA]
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1163 "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1164 "Xtestfile", line 6 col 19; this is an error
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1165 gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1166 Xtestfile:9: parse error before `asd'
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1167 make: *** [vim] Error 1
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1168 in file "Xtestfile" linenr 10: there is an error
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1169
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1170 2 returned
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1171 "Xtestfile", line 11 col 1; this is an error
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1172 "Xtestfile", line 12 col 2; this is another error
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1173 "Xtestfile", line 14:10; this is an error in column 10
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1174 =Xtestfile=, line 15:10; this is another error, but in vcol 10 this time
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1175 "Xtestfile", linenr 16: yet another problem
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1176 Error in "Xtestfile" at line 17:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1177 x should be a dot
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1178 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1179 ^
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1180 Error in "Xtestfile" at line 18:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1181 x should be a dot
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1182 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1183 .............^
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1184 Error in "Xtestfile" at line 19:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1185 x should be a dot
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1186 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1187 --------------^
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1188 Error in "Xtestfile" at line 20:
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1189 x should be a dot
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1190 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1191 ^
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1192
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1193 Does anyone know what is the problem and how to correction it?
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1194 "Xtestfile", line 21 col 9: What is the title of the quickfix window?
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1195 "Xtestfile", line 22 col 9: What is the title of the quickfix window?
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1196 [DATA]
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1197
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1198 call writefile(l, 'Xerrorfile1')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1199 call writefile(l[:-2], 'Xerrorfile2')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1200
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1201 let m =<< [DATA]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1202 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1203 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1204 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1205 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1206 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1207 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1208 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1209 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1210 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1211 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1212 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1213 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1214 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1215 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1216 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1217 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1218 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1219 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1220 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1221 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1222 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1223 [DATA]
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1224 call writefile(m, 'Xtestfile')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1225
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1226 let save_efm = &efm
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1227 set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1228 set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1229
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1230 exe 'cf Xerrorfile2'
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1231 clast
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1232 copen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1233 call assert_equal(':cf Xerrorfile2', w:quickfix_title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1234 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1235
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1236 exe 'cf Xerrorfile1'
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1237 call assert_equal([4, 12], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1238 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1239 call assert_equal([6, 19], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1240 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1241 call assert_equal([9, 2], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1242 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1243 call assert_equal([10, 2], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1244 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1245 call assert_equal([11, 1], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1246 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1247 call assert_equal([12, 2], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1248 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1249 call assert_equal([14, 10], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1250 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1251 call assert_equal([15, 3, 10], [line('.'), col('.'), virtcol('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1252 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1253 call assert_equal([16, 2], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1254 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1255 call assert_equal([17, 6], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1256 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1257 call assert_equal([18, 7], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1258 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1259 call assert_equal([19, 8], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1260 cn
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1261 call assert_equal([20, 9], [line('.'), col('.')])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1262 clast
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1263 cprev
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1264 cprev
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1265 wincmd w
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1266 call assert_equal(':cf Xerrorfile1', w:quickfix_title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1267 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1268
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1269 let &efm = save_efm
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1270 call delete('Xerrorfile1')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1271 call delete('Xerrorfile2')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
1272 call delete('Xtestfile')
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1273 endfunc
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1274
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1275 " Test for quickfix directory stack support
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1276 func s:dir_stack_tests(cchar)
9334
674f9e3ccd1a commit https://github.com/vim/vim/commit/38df43bd13a2498cc96b3ddd9a20dd75126bd171
Christian Brabandt <cb@256bit.org>
parents: 9317
diff changeset
1277 call s:setup_commands(a:cchar)
674f9e3ccd1a commit https://github.com/vim/vim/commit/38df43bd13a2498cc96b3ddd9a20dd75126bd171
Christian Brabandt <cb@256bit.org>
parents: 9317
diff changeset
1278
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1279 let save_efm=&efm
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1280 set efm=%DEntering\ dir\ '%f',%f:%l:%m,%XLeaving\ dir\ '%f'
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1281
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1282 let lines = ["Entering dir 'dir1/a'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1283 \ 'habits2.txt:1:Nine Healthy Habits',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1284 \ "Entering dir 'b'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1285 \ 'habits3.txt:2:0 Hours of television',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1286 \ 'habits2.txt:7:5 Small meals',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1287 \ "Entering dir 'dir1/c'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1288 \ 'habits4.txt:3:1 Hour of exercise',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1289 \ "Leaving dir 'dir1/c'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1290 \ "Leaving dir 'dir1/a'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1291 \ 'habits1.txt:4:2 Liters of water',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1292 \ "Entering dir 'dir2'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1293 \ 'habits5.txt:5:3 Cups of hot green tea',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1294 \ "Leaving dir 'dir2'"
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1295 \]
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1296
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1297 Xexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1298 for l in lines
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1299 Xaddexpr l
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1300 endfor
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1301
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1302 let qf = g:Xgetlist()
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1303
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1304 call assert_equal('dir1/a/habits2.txt', bufname(qf[1].bufnr))
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1305 call assert_equal(1, qf[1].lnum)
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1306 call assert_equal('dir1/a/b/habits3.txt', bufname(qf[3].bufnr))
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1307 call assert_equal(2, qf[3].lnum)
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1308 call assert_equal('dir1/a/habits2.txt', bufname(qf[4].bufnr))
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1309 call assert_equal(7, qf[4].lnum)
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1310 call assert_equal('dir1/c/habits4.txt', bufname(qf[6].bufnr))
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1311 call assert_equal(3, qf[6].lnum)
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1312 call assert_equal('habits1.txt', bufname(qf[9].bufnr))
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1313 call assert_equal(4, qf[9].lnum)
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1314 call assert_equal('dir2/habits5.txt', bufname(qf[11].bufnr))
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1315 call assert_equal(5, qf[11].lnum)
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1316
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1317 let &efm=save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1318 endfunc
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1319
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1320 " Tests for %D and %X errorformat options
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1321 func Test_efm_dirstack()
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1322 " Create the directory stack and files
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1323 call mkdir('dir1')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1324 call mkdir('dir1/a')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1325 call mkdir('dir1/a/b')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1326 call mkdir('dir1/c')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1327 call mkdir('dir2')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1328
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1329 let lines = ["Nine Healthy Habits",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1330 \ "0 Hours of television",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1331 \ "1 Hour of exercise",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1332 \ "2 Liters of water",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1333 \ "3 Cups of hot green tea",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1334 \ "4 Short mental breaks",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1335 \ "5 Small meals",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1336 \ "6 AM wake up time",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1337 \ "7 Minutes of laughter",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1338 \ "8 Hours of sleep (at least)",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1339 \ "9 PM end of the day and off to bed"
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1340 \ ]
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1341 call writefile(lines, 'habits1.txt')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1342 call writefile(lines, 'dir1/a/habits2.txt')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1343 call writefile(lines, 'dir1/a/b/habits3.txt')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1344 call writefile(lines, 'dir1/c/habits4.txt')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1345 call writefile(lines, 'dir2/habits5.txt')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1346
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1347 call s:dir_stack_tests('c')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1348 call s:dir_stack_tests('l')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1349
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1350 call delete('dir1', 'rf')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1351 call delete('dir2', 'rf')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1352 call delete('habits1.txt')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1353 endfunc
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
1354
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1355 " Test for resync after continuing an ignored message
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1356 func Xefm_ignore_continuations(cchar)
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1357 call s:setup_commands(a:cchar)
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1358
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1359 let save_efm = &efm
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1360
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1361 let &efm =
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1362 \ '%Eerror %m %l,' .
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1363 \ '%-Wignored %m %l,' .
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1364 \ '%+Cmore ignored %m %l,' .
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1365 \ '%Zignored end'
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1366 Xgetexpr ['ignored warning 1', 'more ignored continuation 2', 'ignored end', 'error resync 4']
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1367 let l = map(g:Xgetlist(), '[v:val.text, v:val.valid, v:val.lnum, v:val.type]')
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1368 call assert_equal([['resync', 1, 4, 'E']], l)
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1369
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1370 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1371 endfunc
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1372
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1373 func Test_efm_ignore_continuations()
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1374 call Xefm_ignore_continuations('c')
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1375 call Xefm_ignore_continuations('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1376 endfunc
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1377
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1378 " Tests for invalid error format specifies
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1379 func Xinvalid_efm_Tests(cchar)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1380 call s:setup_commands(a:cchar)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1381
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1382 let save_efm = &efm
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1383
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1384 set efm=%f:%l:%m,%f:%f:%l:%m
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1385 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E372:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1386
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1387 set efm=%f:%l:%m,%f:%l:%r:%m
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1388 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E373:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1389
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1390 set efm=%f:%l:%m,%O:%f:%l:%m
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1391 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E373:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1392
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1393 set efm=%f:%l:%m,%f:%l:%*[^a-z
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1394 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E374:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1395
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1396 set efm=%f:%l:%m,%f:%l:%*c
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1397 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E375:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1398
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1399 set efm=%f:%l:%m,%L%M%N
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1400 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E376:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1401
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1402 set efm=%f:%l:%m,%f:%l:%m:%R
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1403 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E377:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1404
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1405 " Invalid regular expression
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1406 set efm=%\\%%k
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1407 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E867:')
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1408
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1409 set efm=
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1410 call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E378:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1411
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1412 " Empty directory name. When there is an error in parsing new entries, make
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1413 " sure the previous quickfix list is made the current list.
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1414 set efm&
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1415 cexpr ["one", "two"]
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1416 let qf_id = getqflist(#{id: 0}).id
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1417 set efm=%DEntering\ dir\ abc,%f:%l:%m
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1418 call assert_fails('Xexpr ["Entering dir abc", "abc.txt:1:Hello world"]', 'E379:')
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1419 call assert_equal(qf_id, getqflist(#{id: 0}).id)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1420
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1421 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1422 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1423
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1424 func Test_invalid_efm()
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1425 call Xinvalid_efm_Tests('c')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1426 call Xinvalid_efm_Tests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1427 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1428
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1429 " TODO:
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1430 " Add tests for the following formats in 'errorformat'
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1431 " %r %O
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1432 func Test_efm2()
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1433 let save_efm = &efm
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1434
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1435 " Test for %s format in efm
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1436 set efm=%f:%s
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1437 cexpr 'Xtestfile:Line search text'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1438 let l = getqflist()
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1439 call assert_equal('^\VLine search text\$', l[0].pattern)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1440 call assert_equal(0, l[0].lnum)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1441
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1442 let l = split(execute('clist', ''), "\n")
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1443 call assert_equal([' 1 Xtestfile:^\VLine search text\$: '], l)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1444
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1445 " Test for a long line
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1446 cexpr 'Xtestfile:' . repeat('a', 1026)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1447 let l = getqflist()
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1448 call assert_equal('^\V' . repeat('a', 1019) . '\$', l[0].pattern)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1449
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1450 " Test for %P, %Q and %t format specifiers
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1451 let lines =<< trim [DATA]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1452 [Xtestfile1]
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1453 (1,17) error: ';' missing
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1454 (21,2) warning: variable 'z' not defined
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1455 (67,3) error: end of file found before string ended
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1456 --
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1457
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1458 [Xtestfile2]
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1459 --
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1460
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1461 [Xtestfile3]
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1462 NEW compiler v1.1
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1463 (2,2) warning: variable 'x' not defined
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1464 (67,3) warning: 's' already defined
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1465 --
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1466 [DATA]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1467
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1468 set efm=%+P[%f]%r,(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%+Q--%r
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1469 " To exercise the push/pop file functionality in quickfix, the test files
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1470 " need to be created.
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1471 call writefile(['Line1'], 'Xtestfile1')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1472 call writefile(['Line2'], 'Xtestfile2')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1473 call writefile(['Line3'], 'Xtestfile3')
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1474 cexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1475 for l in lines
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1476 caddexpr l
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1477 endfor
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1478 let l = getqflist()
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1479 call assert_equal(12, len(l))
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1480 call assert_equal(21, l[2].lnum)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1481 call assert_equal(2, l[2].col)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1482 call assert_equal('w', l[2].type)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1483 call assert_equal('e', l[3].type)
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1484 call delete('Xtestfile1')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1485 call delete('Xtestfile2')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1486 call delete('Xtestfile3')
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1487
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1488 " Test for %P, %Q with non-existing files
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1489 cexpr lines
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1490 let l = getqflist()
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1491 call assert_equal(14, len(l))
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1492 call assert_equal('[Xtestfile1]', l[0].text)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1493 call assert_equal('[Xtestfile2]', l[6].text)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1494 call assert_equal('[Xtestfile3]', l[9].text)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1495
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1496 " Tests for %E, %C and %Z format specifiers
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1497 let lines =<< trim [DATA]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1498 Error 275
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1499 line 42
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1500 column 3
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1501 ' ' expected after '--'
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1502 [DATA]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1503
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1504 set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1505 cgetexpr lines
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1506 let l = getqflist()
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1507 call assert_equal(275, l[0].nr)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1508 call assert_equal(42, l[0].lnum)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1509 call assert_equal(3, l[0].col)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1510 call assert_equal('E', l[0].type)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1511 call assert_equal("\n' ' expected after '--'", l[0].text)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1512
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1513 " Test for %>
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1514 let lines =<< trim [DATA]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1515 Error in line 147 of foo.c:
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1516 unknown variable 'i'
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1517 [DATA]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1518
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1519 set efm=unknown\ variable\ %m,%E%>Error\ in\ line\ %l\ of\ %f:,%Z%m
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1520 cgetexpr lines
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1521 let l = getqflist()
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1522 call assert_equal(147, l[0].lnum)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1523 call assert_equal('E', l[0].type)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1524 call assert_equal("\nunknown variable 'i'", l[0].text)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1525
9568
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1526 " Test for %A, %C and other formats
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1527 let lines =<< trim [DATA]
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1528 ==============================================================
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1529 FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1530 --------------------------------------------------------------
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1531 Traceback (most recent call last):
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1532 File "unittests/dbfacadeTest.py", line 89, in testFoo
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1533 self.assertEquals(34, dtid)
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1534 File "/usr/lib/python2.2/unittest.py", line 286, in
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1535 failUnlessEqual
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1536 raise self.failureException, \\
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1537 W:AssertionError: 34 != 33
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1538
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1539 --------------------------------------------------------------
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
1540 Ran 27 tests in 0.063s
16720
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1541 [DATA]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16555
diff changeset
1542
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1543 set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%t:%m
9568
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1544 cgetexpr lines
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1545 let l = getqflist()
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1546 call assert_equal(8, len(l))
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1547 call assert_equal(89, l[4].lnum)
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1548 call assert_equal(1, l[4].valid)
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1549 call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr))
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1550 call assert_equal('W', l[4].type)
9568
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1551
13821
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1552 " Test for %o
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1553 set efm=%f(%o):%l\ %m
13825
eb7707562201 patch 8.0.1784: gvim test gets stuck in dialog
Christian Brabandt <cb@256bit.org>
parents: 13821
diff changeset
1554 cgetexpr ['Xotestfile(Language.PureScript.Types):20 Error']
eb7707562201 patch 8.0.1784: gvim test gets stuck in dialog
Christian Brabandt <cb@256bit.org>
parents: 13821
diff changeset
1555 call writefile(['Line1'], 'Xotestfile')
13821
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1556 let l = getqflist()
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1557 call assert_equal(1, len(l), string(l))
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1558 call assert_equal('Language.PureScript.Types', l[0].module)
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1559 copen
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1560 call assert_equal('Language.PureScript.Types|20| Error', getline(1))
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1561 call feedkeys("\<CR>", 'xn')
13825
eb7707562201 patch 8.0.1784: gvim test gets stuck in dialog
Christian Brabandt <cb@256bit.org>
parents: 13821
diff changeset
1562 call assert_equal('Xotestfile', expand('%:t'))
13821
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1563 cclose
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1564 bd
13825
eb7707562201 patch 8.0.1784: gvim test gets stuck in dialog
Christian Brabandt <cb@256bit.org>
parents: 13821
diff changeset
1565 call delete("Xotestfile")
13821
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1566
18695
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1567 " Test for a long module name
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1568 cexpr 'Xtest(' . repeat('m', 1026) . '):15 message'
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1569 let l = getqflist()
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1570 call assert_equal(repeat('m', 1024), l[0].module)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1571 call assert_equal(15, l[0].lnum)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1572 call assert_equal('message', l[0].text)
48ded92ce361 patch 8.1.2339: insufficient testing for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18660
diff changeset
1573
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1574 " The following sequence of commands used to crash Vim
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1575 set efm=%W%m
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1576 cgetexpr ['msg1']
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1577 let l = getqflist()
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1578 call assert_equal(1, len(l), string(l))
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1579 call assert_equal('msg1', l[0].text)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1580 set efm=%C%m
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1581 lexpr 'msg2'
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1582 let l = getloclist(0)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1583 call assert_equal(1, len(l), string(l))
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1584 call assert_equal('msg2', l[0].text)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1585 lopen
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1586 call setqflist([], 'r')
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1587 caddbuf
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1588 let l = getqflist()
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1589 call assert_equal(1, len(l), string(l))
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1590 call assert_equal('|| msg2', l[0].text)
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1591
13948
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1592 " When matching error lines, case should be ignored. Test for this.
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1593 set noignorecase
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1594 let l=getqflist({'lines' : ['Xtest:FOO10:Line 20'], 'efm':'%f:foo%l:%m'})
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1595 call assert_equal(10, l.items[0].lnum)
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1596 call assert_equal('Line 20', l.items[0].text)
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1597 set ignorecase&
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1598
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1599 new | only
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1600 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1601 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1602
20729
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1603 " Test for '%t' (error type) field in 'efm'
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1604 func Test_efm_error_type()
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1605 let save_efm = &efm
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1606
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1607 " error type
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1608 set efm=%f:%l:%t:%m
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1609 cexpr ["Xfile1:10:E:msg1", "Xfile1:20:W:msg2", "Xfile1:30:I:msg3",
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1610 \ "Xfile1:40:N:msg4", "Xfile1:50:R:msg5"]
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1611 let output = split(execute('clist'), "\n")
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1612 call assert_equal([
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1613 \ ' 1 Xfile1:10 error: msg1',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1614 \ ' 2 Xfile1:20 warning: msg2',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1615 \ ' 3 Xfile1:30 info: msg3',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1616 \ ' 4 Xfile1:40 note: msg4',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1617 \ ' 5 Xfile1:50 R: msg5'], output)
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1618
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1619 " error type and a error number
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1620 set efm=%f:%l:%t:%n:%m
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1621 cexpr ["Xfile1:10:E:2:msg1", "Xfile1:20:W:4:msg2", "Xfile1:30:I:6:msg3",
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1622 \ "Xfile1:40:N:8:msg4", "Xfile1:50:R:3:msg5"]
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1623 let output = split(execute('clist'), "\n")
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1624 call assert_equal([
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1625 \ ' 1 Xfile1:10 error 2: msg1',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1626 \ ' 2 Xfile1:20 warning 4: msg2',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1627 \ ' 3 Xfile1:30 info 6: msg3',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1628 \ ' 4 Xfile1:40 note 8: msg4',
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1629 \ ' 5 Xfile1:50 R 3: msg5'], output)
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1630 let &efm = save_efm
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1631 endfunc
ada6f26e6eb1 patch 8.2.0917: quickfix entries do not suport a "note" type
Bram Moolenaar <Bram@vim.org>
parents: 20631
diff changeset
1632
27605
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1633 " Test for end_lnum ('%e') and end_col ('%k') fields in 'efm'
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1634 func Test_efm_end_lnum_col()
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1635 let save_efm = &efm
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1636
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1637 " single line
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1638 set efm=%f:%l-%e:%c-%k:%t:%m
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1639 cexpr ["Xfile1:10-20:1-2:E:msg1", "Xfile1:20-30:2-3:W:msg2",]
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1640 let output = split(execute('clist'), "\n")
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1641 call assert_equal([
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1642 \ ' 1 Xfile1:10-20 col 1-2 error: msg1',
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1643 \ ' 2 Xfile1:20-30 col 2-3 warning: msg2'], output)
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1644
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1645 " multiple lines
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1646 set efm=%A%n)%m,%Z%f:%l-%e:%c-%k
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1647 cexpr ["1)msg1", "Xfile1:14-24:1-2",
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1648 \ "2)msg2", "Xfile1:24-34:3-4"]
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1649 let output = split(execute('clist'), "\n")
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1650 call assert_equal([
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1651 \ ' 1 Xfile1:14-24 col 1-2 error 1: msg1',
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1652 \ ' 2 Xfile1:24-34 col 3-4 error 2: msg2'], output)
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1653 let &efm = save_efm
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1654 endfunc
bf540a32439a patch 8.2.4329: no support for end line number and column in 'errorformat'
Bram Moolenaar <Bram@vim.org>
parents: 27601
diff changeset
1655
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1656 func XquickfixChangedByAutocmd(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1657 call s:setup_commands(a:cchar)
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1658 if a:cchar == 'c'
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1659 let ErrorNr = 'E925'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1660 func! ReadFunc()
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1661 colder
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1662 cgetexpr []
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1663 endfunc
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1664 else
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1665 let ErrorNr = 'E926'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1666 func! ReadFunc()
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1667 lolder
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1668 lgetexpr []
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1669 endfunc
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1670 endif
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1671
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1672 augroup QF_Test
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1673 au!
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1674 autocmd BufReadCmd test_changed.txt call ReadFunc()
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1675 augroup END
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1676
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1677 new | only
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1678 let words = [ "a", "b" ]
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1679 let qflist = []
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1680 for word in words
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1681 call add(qflist, {'filename': 'test_changed.txt'})
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1682 call g:Xsetlist(qflist, ' ')
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1683 endfor
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1684 call assert_fails('Xrewind', ErrorNr . ':')
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1685
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1686 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1687 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1688 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1689
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1690 if a:cchar == 'c'
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1691 cexpr ["Xtest1:1:Line"]
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1692 cwindow
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1693 only
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1694 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1695 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1696 autocmd WinEnter * call setqflist([], 'f')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1697 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1698 call assert_fails('exe "normal \<CR>"', 'E925:')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1699 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1700 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1701 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1702 endif
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1703 %bw!
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1704 endfunc
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1705
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1706 func Test_quickfix_was_changed_by_autocmd()
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1707 call XquickfixChangedByAutocmd('c')
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1708 call XquickfixChangedByAutocmd('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1709 endfunc
8716
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1710
22256
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1711 func Test_setloclist_in_autocommand()
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1712 call writefile(['test1', 'test2'], 'Xfile')
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1713 edit Xfile
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1714 let s:bufnr = bufnr()
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1715 call setloclist(1,
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1716 \ [{'bufnr' : s:bufnr, 'lnum' : 1, 'text' : 'test1'},
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1717 \ {'bufnr' : s:bufnr, 'lnum' : 2, 'text' : 'test2'}])
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1718
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1719 augroup Test_LocList
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1720 au!
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1721 autocmd BufEnter * call setloclist(1,
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1722 \ [{'bufnr' : s:bufnr, 'lnum' : 1, 'text' : 'test1'},
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1723 \ {'bufnr' : s:bufnr, 'lnum' : 2, 'text' : 'test2'}], 'r')
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1724 augroup END
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1725
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1726 lopen
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1727 call assert_fails('exe "normal j\<CR>"', 'E926:')
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1728
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1729 augroup Test_LocList
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1730 au!
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1731 augroup END
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1732 call delete('Xfile')
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1733 endfunc
c3c9830c7cdc patch 8.2.1677: memory access errors when calling setloclist() in autocommand
Bram Moolenaar <Bram@vim.org>
parents: 22099
diff changeset
1734
8716
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1735 func Test_caddbuffer_to_empty()
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1736 helpgr quickfix
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1737 call setqflist([], 'r')
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1738 cad
8722
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1739 try
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1740 cn
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1741 catch
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1742 " number of matches is unknown
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1743 call assert_true(v:exception =~ 'E553:')
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1744 endtry
8716
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1745 quit!
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1746 endfunc
8751
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1747
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1748 func Test_cgetexpr_works()
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1749 " this must not crash Vim
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1750 cgetexpr [$x]
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1751 lgetexpr [$x]
8751
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1752 endfunc
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1753
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1754 " Tests for the setqflist() and setloclist() functions
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1755 func SetXlistTests(cchar, bnum)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1756 call s:setup_commands(a:cchar)
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1757
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1758 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 1},
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
1759 \ {'bufnr': a:bnum, 'lnum': 2, 'end_lnum': 3, 'col': 4, 'end_col': 5}])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1760 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1761 call assert_equal(2, len(l))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1762 call assert_equal(2, l[1].lnum)
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
1763 call assert_equal(3, l[1].end_lnum)
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
1764 call assert_equal(4, l[1].col)
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
1765 call assert_equal(5, l[1].end_col)
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1766
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1767 Xnext
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1768 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 3}], 'a')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1769 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1770 call assert_equal(3, len(l))
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1771 Xnext
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1772 call assert_equal(3, line('.'))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1773
9114
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1774 " Appending entries to the list should not change the cursor position
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1775 " in the quickfix window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1776 Xwindow
9114
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1777 1
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1778 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 4},
9114
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1779 \ {'bufnr': a:bnum, 'lnum': 5}], 'a')
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1780 call assert_equal(1, line('.'))
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1781 close
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1782
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1783 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 3},
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1784 \ {'bufnr': a:bnum, 'lnum': 4},
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1785 \ {'bufnr': a:bnum, 'lnum': 5}], 'r')
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1786 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1787 call assert_equal(3, len(l))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1788 call assert_equal(5, l[2].lnum)
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1789
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1790 call g:Xsetlist([])
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1791 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1792 call assert_equal(0, len(l))
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1793
11390
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1794 " Tests for setting the 'valid' flag
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1795 call g:Xsetlist([{'bufnr':a:bnum, 'lnum':4, 'valid':0}])
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1796 Xwindow
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1797 call assert_equal(1, winnr('$'))
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1798 let l = g:Xgetlist()
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1799 call g:Xsetlist(l)
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1800 call assert_equal(0, g:Xgetlist()[0].valid)
15225
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1801 " Adding a non-valid entry should not mark the list as having valid entries
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1802 call g:Xsetlist([{'bufnr':a:bnum, 'lnum':5, 'valid':0}], 'a')
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1803 Xwindow
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1804 call assert_equal(1, winnr('$'))
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1805
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1806 " :cnext/:cprev should still work even with invalid entries in the list
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1807 let l = [{'bufnr' : a:bnum, 'lnum' : 1, 'text' : '1', 'valid' : 0},
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1808 \ {'bufnr' : a:bnum, 'lnum' : 2, 'text' : '2', 'valid' : 0}]
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1809 call g:Xsetlist(l)
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1810 Xnext
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1811 call assert_equal(2, g:Xgetlist({'idx' : 0}).idx)
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1812 Xprev
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1813 call assert_equal(1, g:Xgetlist({'idx' : 0}).idx)
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1814 " :cnext/:cprev should still work after appending invalid entries to an
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1815 " empty list
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1816 call g:Xsetlist([])
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1817 call g:Xsetlist(l, 'a')
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1818 Xnext
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1819 call assert_equal(2, g:Xgetlist({'idx' : 0}).idx)
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1820 Xprev
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1821 call assert_equal(1, g:Xgetlist({'idx' : 0}).idx)
a413374825dd patch 8.1.0622: adding quickfix items marks items as valid errors
Bram Moolenaar <Bram@vim.org>
parents: 15024
diff changeset
1822
11390
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1823 call g:Xsetlist([{'text':'Text1', 'valid':1}])
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1824 Xwindow
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1825 call assert_equal(2, winnr('$'))
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1826 Xclose
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1827 let save_efm = &efm
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1828 set efm=%m
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1829 Xgetexpr 'TestMessage'
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1830 let l = g:Xgetlist()
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1831 call g:Xsetlist(l)
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1832 call assert_equal(1, g:Xgetlist()[0].valid)
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1833 let &efm = save_efm
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1834
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1835 " Error cases:
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1836 " Refer to a non-existing buffer and pass a non-dictionary type
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1837 call assert_fails("call g:Xsetlist([{'bufnr':998, 'lnum':4}," .
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1838 \ " {'bufnr':999, 'lnum':5}])", 'E92:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1839 call g:Xsetlist([[1, 2,3]])
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1840 call assert_equal(0, len(g:Xgetlist()))
20178
2fb397573541 patch 8.2.0644: insufficient testing for invalid function arguments
Bram Moolenaar <Bram@vim.org>
parents: 20158
diff changeset
1841 call assert_fails('call g:Xsetlist([], [])', 'E928:')
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1842 call g:Xsetlist([test_null_dict()])
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
1843 call assert_equal([], g:Xgetlist())
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1844 endfunc
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1845
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1846 func Test_setqflist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1847 new Xtestfile | only
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1848 let bnum = bufnr('%')
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1849 call setline(1, range(1,5))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1850
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1851 call SetXlistTests('c', bnum)
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1852 call SetXlistTests('l', bnum)
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1853
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1854 enew!
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1855 call delete('Xtestfile')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1856 endfunc
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1857
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1858 func Xlist_empty_middle(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1859 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1860
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1861 " create three quickfix lists
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1862 let @/ = 'Test_'
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1863 Xvimgrep // test_quickfix.vim
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1864 let testlen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1865 call assert_true(testlen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1866 Xvimgrep empty test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1867 call assert_true(len(g:Xgetlist()) > 0)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1868 Xvimgrep matches test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1869 let matchlen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1870 call assert_true(matchlen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1871 Xolder
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1872 " make the middle list empty
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1873 call g:Xsetlist([], 'r')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1874 call assert_true(len(g:Xgetlist()) == 0)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1875 Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1876 call assert_equal(testlen, len(g:Xgetlist()))
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1877 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1878 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1879 call assert_equal(matchlen, len(g:Xgetlist()))
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1880 endfunc
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1881
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1882 func Test_setqflist_empty_middle()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1883 call Xlist_empty_middle('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1884 call Xlist_empty_middle('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1885 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1886
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1887 func Xlist_empty_older(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1888 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1889
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1890 " create three quickfix lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1891 Xvimgrep one test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1892 let onelen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1893 call assert_true(onelen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1894 Xvimgrep two test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1895 let twolen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1896 call assert_true(twolen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1897 Xvimgrep three test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1898 let threelen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1899 call assert_true(threelen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1900 Xolder 2
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1901 " make the first list empty, check the others didn't change
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1902 call g:Xsetlist([], 'r')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1903 call assert_true(len(g:Xgetlist()) == 0)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1904 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1905 call assert_equal(twolen, len(g:Xgetlist()))
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1906 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1907 call assert_equal(threelen, len(g:Xgetlist()))
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1908 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1909
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1910 func Test_setqflist_empty_older()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1911 call Xlist_empty_older('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1912 call Xlist_empty_older('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1913 endfunc
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1914
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1915 func XquickfixSetListWithAct(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1916 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1917
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1918 let list1 = [{'filename': 'fnameA', 'text': 'A'},
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1919 \ {'filename': 'fnameB', 'text': 'B'}]
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1920 let list2 = [{'filename': 'fnameC', 'text': 'C'},
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1921 \ {'filename': 'fnameD', 'text': 'D'},
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1922 \ {'filename': 'fnameE', 'text': 'E'}]
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1923
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
1924 " {action} is unspecified. Same as specifying ' '.
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1925 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1926 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1927 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1928 call g:Xsetlist(list2)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1929 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1930 call assert_equal(3, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1931 call assert_equal('C', li[0]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1932 call assert_equal('D', li[1]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1933 call assert_equal('E', li[2]['text'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1934 silent! Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1935 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1936 call assert_equal(2, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1937 call assert_equal('A', li[0]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1938 call assert_equal('B', li[1]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1939
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1940 " {action} is specified ' '.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1941 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1942 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1943 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1944 call g:Xsetlist(list2, ' ')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1945 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1946 call assert_equal(3, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1947 call assert_equal('C', li[0]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1948 call assert_equal('D', li[1]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1949 call assert_equal('E', li[2]['text'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1950 silent! Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1951 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1952 call assert_equal(2, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1953 call assert_equal('A', li[0]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1954 call assert_equal('B', li[1]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1955
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1956 " {action} is specified 'a'.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1957 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1958 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1959 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1960 call g:Xsetlist(list2, 'a')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1961 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1962 call assert_equal(5, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1963 call assert_equal('A', li[0]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1964 call assert_equal('B', li[1]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1965 call assert_equal('C', li[2]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1966 call assert_equal('D', li[3]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1967 call assert_equal('E', li[4]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1968
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1969 " {action} is specified 'r'.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1970 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1971 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1972 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1973 call g:Xsetlist(list2, 'r')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1974 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1975 call assert_equal(3, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1976 call assert_equal('C', li[0]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1977 call assert_equal('D', li[1]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1978 call assert_equal('E', li[2]['text'])
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1979
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1980 " Test for wrong value.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1981 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1982 call assert_fails("call g:Xsetlist(0)", 'E714:')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1983 call assert_fails("call g:Xsetlist(list1, '')", 'E927:')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1984 call assert_fails("call g:Xsetlist(list1, 'aa')", 'E927:')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1985 call assert_fails("call g:Xsetlist(list1, ' a')", 'E927:')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1986 call assert_fails("call g:Xsetlist(list1, 0)", 'E928:')
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1987 endfunc
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1988
13066
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1989 func Test_setqflist_invalid_nr()
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1990 " The following command used to crash Vim
18000
7a19c8d6bb9e patch 8.1.1996: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17918
diff changeset
1991 eval []->setqflist(' ', {'nr' : $XXX_DOES_NOT_EXIST})
13066
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1992 endfunc
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1993
19366
102f9a44c8b3 patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Bram Moolenaar <Bram@vim.org>
parents: 19308
diff changeset
1994 func Test_setqflist_user_sets_buftype()
102f9a44c8b3 patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Bram Moolenaar <Bram@vim.org>
parents: 19308
diff changeset
1995 call setqflist([{'text': 'foo'}, {'text': 'bar'}])
102f9a44c8b3 patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Bram Moolenaar <Bram@vim.org>
parents: 19308
diff changeset
1996 set buftype=quickfix
102f9a44c8b3 patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Bram Moolenaar <Bram@vim.org>
parents: 19308
diff changeset
1997 call setqflist([], 'a')
102f9a44c8b3 patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Bram Moolenaar <Bram@vim.org>
parents: 19308
diff changeset
1998 enew
102f9a44c8b3 patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Bram Moolenaar <Bram@vim.org>
parents: 19308
diff changeset
1999 endfunc
102f9a44c8b3 patch 8.2.0241: crash when setting 'buftype' to "quickfix"
Bram Moolenaar <Bram@vim.org>
parents: 19308
diff changeset
2000
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2001 func Test_quickfix_set_list_with_act()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
2002 call XquickfixSetListWithAct('c')
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
2003 call XquickfixSetListWithAct('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2004 endfunc
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2005
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2006 func XLongLinesTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2007 let l = g:Xgetlist()
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2008
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2009 call assert_equal(4, len(l))
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2010 call assert_equal(1, l[0].lnum)
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2011 call assert_equal(1, l[0].col)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2012 call assert_equal(1975, len(l[0].text))
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2013 call assert_equal(2, l[1].lnum)
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2014 call assert_equal(1, l[1].col)
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2015 call assert_equal(4070, len(l[1].text))
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2016 call assert_equal(3, l[2].lnum)
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2017 call assert_equal(1, l[2].col)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2018 call assert_equal(4070, len(l[2].text))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2019 call assert_equal(4, l[3].lnum)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2020 call assert_equal(1, l[3].col)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2021 call assert_equal(10, len(l[3].text))
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2022
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2023 call g:Xsetlist([], 'r')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2024 endfunc
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2025
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2026 func s:long_lines_tests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2027 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2028
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2029 let testfile = 'samples/quickfix.txt'
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2030
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2031 " file
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2032 exe 'Xgetfile' testfile
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2033 call XLongLinesTests(a:cchar)
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2034
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2035 " list
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2036 Xexpr readfile(testfile)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2037 call XLongLinesTests(a:cchar)
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2038
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2039 " string
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2040 Xexpr join(readfile(testfile), "\n")
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2041 call XLongLinesTests(a:cchar)
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2042
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
2043 " buffer
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2044 exe 'edit' testfile
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2045 exe 'Xbuffer' bufnr('%')
9336
52bda0e40ea2 commit https://github.com/vim/vim/commit/f50df3925b7c909d1cda4c868d8c7ba38189aabe
Christian Brabandt <cb@256bit.org>
parents: 9334
diff changeset
2046 call XLongLinesTests(a:cchar)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2047 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2048
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2049 func Test_long_lines()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2050 call s:long_lines_tests('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
2051 call s:long_lines_tests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2052 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2053
22099
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2054 func Test_cgetfile_on_long_lines()
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2055 " Problematic values if the line is longer than 4096 bytes. Then 1024 bytes
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2056 " are read at a time.
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2057 for len in [4078, 4079, 4080, 5102, 5103, 5104, 6126, 6127, 6128, 7150, 7151, 7152]
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2058 let lines = [
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2059 \ '/tmp/file1:1:1:aaa',
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2060 \ '/tmp/file2:1:1:%s',
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2061 \ '/tmp/file3:1:1:bbb',
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2062 \ '/tmp/file4:1:1:ccc',
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2063 \ ]
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2064 let lines[1] = substitute(lines[1], '%s', repeat('x', len), '')
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2065 call writefile(lines, 'Xcqetfile.txt')
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2066 cgetfile Xcqetfile.txt
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2067 call assert_equal(4, getqflist(#{size: v:true}).size, 'with length ' .. len)
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2068 endfor
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2069 call delete('Xcqetfile.txt')
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2070 endfunc
b7cc5d8ea702 patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Bram Moolenaar <Bram@vim.org>
parents: 22087
diff changeset
2071
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2072 func s:create_test_file(filename)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2073 let l = []
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2074 for i in range(1, 20)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2075 call add(l, 'Line' . i)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2076 endfor
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2077 call writefile(l, a:filename)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2078 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2079
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2080 func Test_switchbuf()
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2081 call s:create_test_file('Xqftestfile1')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2082 call s:create_test_file('Xqftestfile2')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2083 call s:create_test_file('Xqftestfile3')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2084
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2085 new | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2086 edit Xqftestfile1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2087 let file1_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2088 new Xqftestfile2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2089 let file2_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2090 cgetexpr ['Xqftestfile1:5:Line5',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2091 \ 'Xqftestfile1:6:Line6',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2092 \ 'Xqftestfile2:10:Line10',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2093 \ 'Xqftestfile2:11:Line11',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2094 \ 'Xqftestfile3:15:Line15',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2095 \ 'Xqftestfile3:16:Line16']
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2096
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2097 new
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2098 let winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2099 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2100 call assert_equal(winid, win_getid())
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
2101 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2102 call assert_equal(winid, win_getid())
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
2103 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2104 call assert_equal(winid, win_getid())
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2105
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2106 " Test for 'switchbuf' set to search for files in windows in the current
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2107 " tabpage and jump to an existing window (if present)
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2108 set switchbuf=useopen
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2109 enew
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2110 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2111 call assert_equal(file1_winid, win_getid())
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
2112 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2113 call assert_equal(file2_winid, win_getid())
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
2114 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2115 call assert_equal(file2_winid, win_getid())
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2116
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2117 " Test for 'switchbuf' set to search for files in tabpages and jump to an
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2118 " existing tabpage (if present)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2119 enew | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2120 set switchbuf=usetab
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2121 tabedit Xqftestfile1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2122 tabedit Xqftestfile2
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2123 tabedit Xqftestfile3
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2124 tabfirst
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2125 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2126 call assert_equal(2, tabpagenr())
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
2127 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2128 call assert_equal(3, tabpagenr())
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2129 6cnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2130 call assert_equal(4, tabpagenr())
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2131 2cpfile
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2132 call assert_equal(2, tabpagenr())
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2133 2cnfile
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2134 call assert_equal(4, tabpagenr())
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2135 tabfirst | tabonly | enew
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2136
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2137 " Test for 'switchbuf' set to open a new window for every file
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2138 set switchbuf=split
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2139 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2140 call assert_equal(1, winnr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2141 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2142 call assert_equal(2, winnr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2143 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2144 call assert_equal(3, winnr('$'))
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2145
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2146 " Test for 'switchbuf' set to open a new tabpage for every file
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2147 set switchbuf=newtab
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2148 enew | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2149 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2150 call assert_equal(1, tabpagenr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2151 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2152 call assert_equal(2, tabpagenr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2153 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2154 call assert_equal(3, tabpagenr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2155 tabfirst | enew | tabonly | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2156
18646
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2157 set switchbuf=uselast
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2158 split
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2159 let last_winid = win_getid()
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2160 copen
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2161 exe "normal 1G\<CR>"
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2162 call assert_equal(last_winid, win_getid())
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2163 enew | only
394abd397e15 patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents: 18635
diff changeset
2164
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2165 " With an empty 'switchbuf', jumping to a quickfix entry should open the
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2166 " file in an existing window (if present)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2167 set switchbuf=
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2168 edit Xqftestfile1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2169 let file1_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2170 new Xqftestfile2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2171 let file2_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2172 copen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2173 exe "normal 1G\<CR>"
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2174 call assert_equal(file1_winid, win_getid())
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2175 copen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2176 exe "normal 3G\<CR>"
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2177 call assert_equal(file2_winid, win_getid())
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2178 copen | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2179 exe "normal 5G\<CR>"
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2180 call assert_equal(2, winnr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2181 call assert_equal(1, bufwinnr('Xqftestfile3'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2182
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2183 " If only quickfix window is open in the current tabpage, jumping to an
17918
9606c0adc148 patch 8.1.1955: tests contain typos
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
2184 " entry with 'switchbuf' set to 'usetab' should search in other tabpages.
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2185 enew | only
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2186 set switchbuf=usetab
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2187 tabedit Xqftestfile1
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2188 tabedit Xqftestfile2
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2189 tabedit Xqftestfile3
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2190 tabfirst
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2191 copen | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2192 clast
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2193 call assert_equal(4, tabpagenr())
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2194 tabfirst | tabonly | enew | only
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2195
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2196 " Jumping to a file that is not present in any of the tabpages and the
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2197 " current tabpage doesn't have any usable windows, should open it in a new
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2198 " window in the current tabpage.
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2199 copen | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2200 cfirst
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2201 call assert_equal(1, tabpagenr())
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
2202 call assert_equal('Xqftestfile1', @%)
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2203
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2204 " If opening a file changes 'switchbuf', then the new value should be
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2205 " retained.
20263
a85a3207679f patch 8.2.0687: some tests do not work on FreeBSD
Bram Moolenaar <Bram@vim.org>
parents: 20178
diff changeset
2206 set modeline&vim
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2207 call writefile(["vim: switchbuf=split"], 'Xqftestfile1')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2208 enew | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2209 set switchbuf&vim
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2210 cexpr "Xqftestfile1:1:10"
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2211 call assert_equal('split', &switchbuf)
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2212 call writefile(["vim: switchbuf=usetab"], 'Xqftestfile1')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2213 enew | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2214 set switchbuf=useopen
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2215 cexpr "Xqftestfile1:1:10"
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2216 call assert_equal('usetab', &switchbuf)
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2217 call writefile(["vim: switchbuf&vim"], 'Xqftestfile1')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2218 enew | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2219 set switchbuf=useopen
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2220 cexpr "Xqftestfile1:1:10"
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2221 call assert_equal('', &switchbuf)
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2222
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2223 call delete('Xqftestfile1')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2224 call delete('Xqftestfile2')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2225 call delete('Xqftestfile3')
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2226 set switchbuf&vim
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2227
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2228 enew | only
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2229 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2230
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2231 func Xadjust_qflnum(cchar)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2232 call s:setup_commands(a:cchar)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2233
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2234 enew | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2235
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2236 let fname = 'Xqftestfile' . a:cchar
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2237 call s:create_test_file(fname)
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2238 exe 'edit ' . fname
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2239
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2240 Xgetexpr [fname . ':5:Line5',
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2241 \ fname . ':10:Line10',
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2242 \ fname . ':15:Line15',
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2243 \ fname . ':20:Line20']
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2244
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2245 6,14delete
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2246 call append(6, ['Buffer', 'Window'])
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2247
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2248 let l = g:Xgetlist()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2249 call assert_equal(5, l[0].lnum)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2250 call assert_equal(6, l[2].lnum)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2251 call assert_equal(13, l[3].lnum)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2252
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2253 " If a file doesn't have any quickfix entries, then deleting lines in the
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2254 " file should not update the quickfix list
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2255 call g:Xsetlist([], 'f')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2256 1,2delete
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2257 call assert_equal([], g:Xgetlist())
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2258
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2259 enew!
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2260 call delete(fname)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2261 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2262
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2263 func Test_adjust_lnum()
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2264 call setloclist(0, [])
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2265 call Xadjust_qflnum('c')
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
2266 call setqflist([])
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2267 call Xadjust_qflnum('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2268 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2269
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2270 " Tests for the :grep/:lgrep and :grepadd/:lgrepadd commands
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2271 func s:test_xgrep(cchar)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2272 call s:setup_commands(a:cchar)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2273
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2274 " The following lines are used for the grep test. Don't remove.
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2275 " Grep_Test_Text: Match 1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2276 " Grep_Test_Text: Match 2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2277 " GrepAdd_Test_Text: Match 1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2278 " GrepAdd_Test_Text: Match 2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2279 enew! | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2280 set makeef&vim
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2281 silent Xgrep Grep_Test_Text: test_quickfix.vim
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2282 call assert_true(len(g:Xgetlist()) == 5)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2283 Xopen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2284 call assert_true(w:quickfix_title =~ '^:grep')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2285 Xclose
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2286 enew
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2287 set makeef=Temp_File_##
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2288 silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2289 call assert_true(len(g:Xgetlist()) == 9)
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2290
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2291 " Try with 'grepprg' set to 'internal'
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2292 set grepprg=internal
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2293 silent Xgrep Grep_Test_Text: test_quickfix.vim
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2294 silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2295 call assert_true(len(g:Xgetlist()) == 9)
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2296 set grepprg&vim
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2297
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2298 call writefile(['Vim'], 'XtestTempFile')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2299 set makeef=XtestTempFile
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2300 silent Xgrep Grep_Test_Text: test_quickfix.vim
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2301 call assert_equal(5, len(g:Xgetlist()))
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2302 call assert_false(filereadable('XtestTempFile'))
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
2303 set makeef&vim
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2304 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2305
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2306 func Test_grep()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2307 " The grepprg may not be set on non-Unix systems
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2308 CheckUnix
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2309
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2310 call s:test_xgrep('c')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
2311 call s:test_xgrep('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2312 endfunc
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2313
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2314 func Test_two_windows()
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2315 " Use one 'errorformat' for two windows. Add an expression to each of them,
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2316 " make sure they each keep their own state.
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2317 set efm=%DEntering\ dir\ '%f',%f:%l:%m,%XLeaving\ dir\ '%f'
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2318 call mkdir('Xone/a', 'p')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2319 call mkdir('Xtwo/a', 'p')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2320 let lines = ['1', '2', 'one one one', '4', 'two two two', '6', '7']
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2321 call writefile(lines, 'Xone/a/one.txt')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2322 call writefile(lines, 'Xtwo/a/two.txt')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2323
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2324 new one
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2325 let one_id = win_getid()
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2326 lexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2327 new two
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2328 let two_id = win_getid()
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2329 lexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2330
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2331 laddexpr "Entering dir 'Xtwo/a'"
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2332 call win_gotoid(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2333 laddexpr "Entering dir 'Xone/a'"
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2334 call win_gotoid(two_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2335 laddexpr 'two.txt:5:two two two'
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2336 call win_gotoid(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2337 laddexpr 'one.txt:3:one one one'
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2338
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2339 let loc_one = getloclist(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2340 call assert_equal('Xone/a/one.txt', bufname(loc_one[1].bufnr))
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2341 call assert_equal(3, loc_one[1].lnum)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2342
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2343 let loc_two = getloclist(two_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2344 call assert_equal('Xtwo/a/two.txt', bufname(loc_two[1].bufnr))
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2345 call assert_equal(5, loc_two[1].lnum)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2346
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2347 call win_gotoid(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2348 bwipe!
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2349 call win_gotoid(two_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2350 bwipe!
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2351 call delete('Xone', 'rf')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2352 call delete('Xtwo', 'rf')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
2353 endfunc
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
2354
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2355 func XbottomTests(cchar)
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2356 call s:setup_commands(a:cchar)
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2357
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
2358 " Calling lbottom without any errors should fail
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
2359 if a:cchar == 'l'
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
2360 call assert_fails('lbottom', 'E776:')
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
2361 endif
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
2362
11502
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2363 call g:Xsetlist([{'filename': 'foo', 'lnum': 42}])
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2364 Xopen
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
2365 let wid = win_getid()
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
2366 call assert_equal(1, line('.'))
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
2367 wincmd w
11502
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2368 call g:Xsetlist([{'filename': 'var', 'lnum': 24}], 'a')
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2369 Xbottom
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
2370 call win_gotoid(wid)
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
2371 call assert_equal(2, line('.'))
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2372 Xclose
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
2373 endfunc
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2374
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2375 " Tests for the :cbottom and :lbottom commands
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2376 func Test_cbottom()
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2377 call XbottomTests('c')
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
2378 call XbottomTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2379 endfunc
9538
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2380
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2381 func HistoryTest(cchar)
9538
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2382 call s:setup_commands(a:cchar)
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2383
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2384 " clear all lists after the first one, then replace the first one.
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2385 call g:Xsetlist([])
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
2386 call assert_fails('Xolder 99', 'E380:')
9538
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2387 let entry = {'filename': 'foo', 'lnum': 42}
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2388 call g:Xsetlist([entry], 'r')
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2389 call g:Xsetlist([entry, entry])
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2390 call g:Xsetlist([entry, entry, entry])
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2391 let res = split(execute(a:cchar . 'hist'), "\n")
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2392 call assert_equal(3, len(res))
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2393 let common = 'errors :set' . (a:cchar == 'c' ? 'qf' : 'loc') . 'list()'
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2394 call assert_equal(' error list 1 of 3; 1 ' . common, res[0])
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2395 call assert_equal(' error list 2 of 3; 2 ' . common, res[1])
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2396 call assert_equal('> error list 3 of 3; 3 ' . common, res[2])
12427
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
2397
16555
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2398 " Test for changing the quickfix lists
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2399 call assert_equal(3, g:Xgetlist({'nr' : 0}).nr)
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2400 exe '1' . a:cchar . 'hist'
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2401 call assert_equal(1, g:Xgetlist({'nr' : 0}).nr)
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2402 exe '3' . a:cchar . 'hist'
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2403 call assert_equal(3, g:Xgetlist({'nr' : 0}).nr)
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2404 call assert_fails('-2' . a:cchar . 'hist', 'E16:')
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2405 call assert_fails('4' . a:cchar . 'hist', 'E16:')
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2406
12427
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
2407 call g:Xsetlist([], 'f')
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
2408 let l = split(execute(a:cchar . 'hist'), "\n")
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
2409 call assert_equal('No entries', l[0])
16555
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2410 if a:cchar == 'c'
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2411 call assert_fails('4chist', 'E16:')
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2412 else
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2413 call assert_fails('4lhist', 'E776:')
1302bc0b80db patch 8.1.1281: cannot specify a count with :chistory
Bram Moolenaar <Bram@vim.org>
parents: 16543
diff changeset
2414 endif
15424
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2415
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2416 " An empty list should still show the stack history
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2417 call g:Xsetlist([])
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2418 let res = split(execute(a:cchar . 'hist'), "\n")
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2419 call assert_equal('> error list 1 of 1; 0 ' . common, res[0])
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2420
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2421 call g:Xsetlist([], 'f')
9538
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2422 endfunc
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2423
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2424 func Test_history()
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2425 call HistoryTest('c')
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2426 call HistoryTest('l')
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
2427 endfunc
9540
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2428
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2429 func Test_duplicate_buf()
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2430 " make sure we can get the highest buffer number
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2431 edit DoesNotExist
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2432 edit DoesNotExist2
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2433 let last_buffer = bufnr("$")
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2434
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2435 " make sure only one buffer is created
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2436 call writefile(['this one', 'that one'], 'Xgrepthis')
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2437 vimgrep one Xgrepthis
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2438 vimgrep one Xgrepthis
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2439 call assert_equal(last_buffer + 1, bufnr("$"))
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2440
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2441 call delete('Xgrepthis')
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
2442 endfunc
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
2443
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
2444 " Quickfix/Location list set/get properties tests
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2445 func Xproperty_tests(cchar)
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2446 call s:setup_commands(a:cchar)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2447
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2448 " Error cases
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2449 call assert_fails('call g:Xgetlist(99)', 'E715:')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2450 call assert_fails('call g:Xsetlist(99)', 'E714:')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2451 call assert_fails('call g:Xsetlist([], "a", [])', 'E715:')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2452
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2453 " Set and get the title
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2454 call g:Xsetlist([])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2455 Xopen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2456 wincmd p
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2457 call g:Xsetlist([{'filename':'foo', 'lnum':27}])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2458 let s = g:Xsetlist([], 'a', {'title' : 'Sample'})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2459 call assert_equal(0, s)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2460 let d = g:Xgetlist({"title":1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2461 call assert_equal('Sample', d.title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2462 " Try setting title to a non-string value
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2463 call assert_equal(-1, g:Xsetlist([], 'a', {'title' : ['Test']}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2464 call assert_equal('Sample', g:Xgetlist({"title":1}).title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2465
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2466 Xopen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2467 call assert_equal('Sample', w:quickfix_title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2468 Xclose
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2469
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2470 " Tests for action argument
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2471 silent! Xolder 999
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2472 let qfnr = g:Xgetlist({'all':1}).nr
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2473 call g:Xsetlist([], 'r', {'title' : 'N1'})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2474 call assert_equal('N1', g:Xgetlist({'all':1}).title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2475 call g:Xsetlist([], ' ', {'title' : 'N2'})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2476 call assert_equal(qfnr + 1, g:Xgetlist({'all':1}).nr)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2477
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2478 let res = g:Xgetlist({'nr': 0})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2479 call assert_equal(qfnr + 1, res.nr)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2480 call assert_equal(['nr'], keys(res))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2481
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2482 call g:Xsetlist([], ' ', {'title' : 'N3'})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2483 call assert_equal('N2', g:Xgetlist({'nr':2, 'title':1}).title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2484
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2485 " Changing the title of an earlier quickfix list
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2486 call g:Xsetlist([], 'r', {'title' : 'NewTitle', 'nr' : 2})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2487 call assert_equal('NewTitle', g:Xgetlist({'nr':2, 'title':1}).title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2488
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2489 " Changing the title of an invalid quickfix list
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2490 call assert_equal(-1, g:Xsetlist([], ' ',
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2491 \ {'title' : 'SomeTitle', 'nr' : 99}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2492 call assert_equal(-1, g:Xsetlist([], ' ',
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2493 \ {'title' : 'SomeTitle', 'nr' : 'abc'}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2494
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2495 if a:cchar == 'c'
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2496 copen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2497 call assert_equal({'winid':win_getid()}, getqflist({'winid':1}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2498 cclose
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2499 endif
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2500
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2501 " Invalid arguments
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
2502 call assert_fails('call g:Xgetlist([])', 'E715:')
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
2503 call assert_fails('call g:Xsetlist([], "a", [])', 'E715:')
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2504 let s = g:Xsetlist([], 'a', {'abc':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2505 call assert_equal(-1, s)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2506
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2507 call assert_equal({}, g:Xgetlist({'abc':1}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2508 call assert_equal('', g:Xgetlist({'nr':99, 'title':1}).title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2509 call assert_equal('', g:Xgetlist({'nr':[], 'title':1}).title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2510
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2511 if a:cchar == 'l'
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2512 call assert_equal({}, getloclist(99, {'title': 1}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2513 endif
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2514
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2515 " Context related tests
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2516 let s = g:Xsetlist([], 'a', {'context':[1,2,3]})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2517 call assert_equal(0, s)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2518 call test_garbagecollect_now()
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2519 let d = g:Xgetlist({'context':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2520 call assert_equal([1,2,3], d.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2521 call g:Xsetlist([], 'a', {'context':{'color':'green'}})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2522 let d = g:Xgetlist({'context':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2523 call assert_equal({'color':'green'}, d.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2524 call g:Xsetlist([], 'a', {'context':"Context info"})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2525 let d = g:Xgetlist({'context':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2526 call assert_equal("Context info", d.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2527 call g:Xsetlist([], 'a', {'context':246})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2528 let d = g:Xgetlist({'context':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2529 call assert_equal(246, d.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2530 " set other Vim data types as context
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2531 call g:Xsetlist([], 'a', {'context' : test_null_blob()})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2532 if has('channel')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2533 call g:Xsetlist([], 'a', {'context' : test_null_channel()})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2534 endif
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2535 if has('job')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2536 call g:Xsetlist([], 'a', {'context' : test_null_job()})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2537 endif
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2538 call g:Xsetlist([], 'a', {'context' : test_null_function()})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2539 call g:Xsetlist([], 'a', {'context' : test_null_partial()})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2540 call g:Xsetlist([], 'a', {'context' : ''})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2541 call test_garbagecollect_now()
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2542 if a:cchar == 'l'
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2543 " Test for copying context across two different location lists
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2544 new | only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2545 let w1_id = win_getid()
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2546 let l = [1]
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2547 call setloclist(0, [], 'a', {'context':l})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2548 new
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2549 let w2_id = win_getid()
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2550 call add(l, 2)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2551 call assert_equal([1, 2], getloclist(w1_id, {'context':1}).context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2552 call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2553 unlet! l
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2554 call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2555 only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2556 call setloclist(0, [], 'f')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2557 call assert_equal('', getloclist(0, {'context':1}).context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2558 endif
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2559
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2560 " Test for changing the context of previous quickfix lists
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2561 call g:Xsetlist([], 'f')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2562 Xexpr "One"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2563 Xexpr "Two"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2564 Xexpr "Three"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2565 call g:Xsetlist([], 'r', {'context' : [1], 'nr' : 1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2566 call g:Xsetlist([], 'a', {'context' : [2], 'nr' : 2})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2567 " Also, check for setting the context using quickfix list number zero.
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2568 call g:Xsetlist([], 'r', {'context' : [3], 'nr' : 0})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2569 call test_garbagecollect_now()
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2570 let l = g:Xgetlist({'nr' : 1, 'context' : 1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2571 call assert_equal([1], l.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2572 let l = g:Xgetlist({'nr' : 2, 'context' : 1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2573 call assert_equal([2], l.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2574 let l = g:Xgetlist({'nr' : 3, 'context' : 1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2575 call assert_equal([3], l.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2576
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2577 " Test for changing the context through reference and for garbage
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2578 " collection of quickfix context
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2579 let l = ["red"]
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2580 call g:Xsetlist([], ' ', {'context' : l})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2581 call add(l, "blue")
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2582 let x = g:Xgetlist({'context' : 1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2583 call add(x.context, "green")
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2584 call assert_equal(["red", "blue", "green"], l)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2585 call assert_equal(["red", "blue", "green"], x.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2586 unlet l
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2587 call test_garbagecollect_now()
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2588 let m = g:Xgetlist({'context' : 1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2589 call assert_equal(["red", "blue", "green"], m.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2590
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2591 " Test for setting/getting items
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2592 Xexpr ""
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2593 let qfprev = g:Xgetlist({'nr':0})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2594 let s = g:Xsetlist([], ' ', {'title':'Green',
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2595 \ 'items' : [{'filename':'F1', 'lnum':10}]})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2596 call assert_equal(0, s)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2597 let qfcur = g:Xgetlist({'nr':0})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2598 call assert_true(qfcur.nr == qfprev.nr + 1)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2599 let l = g:Xgetlist({'items':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2600 call assert_equal('F1', bufname(l.items[0].bufnr))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2601 call assert_equal(10, l.items[0].lnum)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2602 call g:Xsetlist([], 'a', {'items' : [{'filename':'F2', 'lnum':20},
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2603 \ {'filename':'F2', 'lnum':30}]})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2604 let l = g:Xgetlist({'items':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2605 call assert_equal('F2', bufname(l.items[2].bufnr))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2606 call assert_equal(30, l.items[2].lnum)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2607 call g:Xsetlist([], 'r', {'items' : [{'filename':'F3', 'lnum':40}]})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2608 let l = g:Xgetlist({'items':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2609 call assert_equal('F3', bufname(l.items[0].bufnr))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2610 call assert_equal(40, l.items[0].lnum)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2611 call g:Xsetlist([], 'r', {'items' : []})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2612 let l = g:Xgetlist({'items':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2613 call assert_equal(0, len(l.items))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2614
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2615 call g:Xsetlist([], 'r', {'title' : 'TestTitle'})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2616 call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F1', 'lnum' : 10, 'text' : 'L10'}]})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2617 call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F1', 'lnum' : 10, 'text' : 'L10'}]})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2618 call assert_equal('TestTitle', g:Xgetlist({'title' : 1}).title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2619
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2620 " Test for getting id of window associated with a location list window
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2621 if a:cchar == 'l'
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2622 only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2623 call assert_equal(0, g:Xgetlist({'all' : 1}).filewinid)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2624 let wid = win_getid()
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
2625 Xopen
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2626 call assert_equal(wid, g:Xgetlist({'filewinid' : 1}).filewinid)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2627 wincmd w
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2628 call assert_equal(0, g:Xgetlist({'filewinid' : 1}).filewinid)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2629 only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2630 endif
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2631
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2632 " The following used to crash Vim with address sanitizer
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2633 call g:Xsetlist([], 'f')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2634 call g:Xsetlist([], 'a', {'items' : [{'filename':'F1', 'lnum':10}]})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2635 call assert_equal(10, g:Xgetlist({'items':1}).items[0].lnum)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2636
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2637 " Try setting the items using a string
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2638 call assert_equal(-1, g:Xsetlist([], ' ', {'items' : 'Test'}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2639
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2640 " Save and restore the quickfix stack
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2641 call g:Xsetlist([], 'f')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2642 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2643 Xexpr "File1:10:Line1"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2644 Xexpr "File2:20:Line2"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2645 Xexpr "File3:30:Line3"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2646 let last_qf = g:Xgetlist({'nr':'$'}).nr
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2647 call assert_equal(3, last_qf)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2648 let qstack = []
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2649 for i in range(1, last_qf)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2650 let qstack = add(qstack, g:Xgetlist({'nr':i, 'all':1}))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2651 endfor
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2652 call g:Xsetlist([], 'f')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2653 for i in range(len(qstack))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2654 call g:Xsetlist([], ' ', qstack[i])
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2655 endfor
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2656 call assert_equal(3, g:Xgetlist({'nr':'$'}).nr)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2657 call assert_equal(10, g:Xgetlist({'nr':1, 'items':1}).items[0].lnum)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2658 call assert_equal(20, g:Xgetlist({'nr':2, 'items':1}).items[0].lnum)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2659 call assert_equal(30, g:Xgetlist({'nr':3, 'items':1}).items[0].lnum)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2660 call g:Xsetlist([], 'f')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2661
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2662 " Swap two quickfix lists
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2663 Xexpr "File1:10:Line10"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2664 Xexpr "File2:20:Line20"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2665 Xexpr "File3:30:Line30"
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2666 call g:Xsetlist([], 'r', {'nr':1,'title':'Colors','context':['Colors']})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2667 call g:Xsetlist([], 'r', {'nr':2,'title':'Fruits','context':['Fruits']})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2668 let l1=g:Xgetlist({'nr':1,'all':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2669 let l2=g:Xgetlist({'nr':2,'all':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2670 let save_id = l1.id
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2671 let l1.id=l2.id
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2672 let l2.id=save_id
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2673 call g:Xsetlist([], 'r', l1)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2674 call g:Xsetlist([], 'r', l2)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2675 let newl1=g:Xgetlist({'nr':1,'all':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2676 let newl2=g:Xgetlist({'nr':2,'all':1})
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2677 call assert_equal('Fruits', newl1.title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2678 call assert_equal(['Fruits'], newl1.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2679 call assert_equal('Line20', newl1.items[0].text)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2680 call assert_equal('Colors', newl2.title)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2681 call assert_equal(['Colors'], newl2.context)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2682 call assert_equal('Line10', newl2.items[0].text)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2683 call g:Xsetlist([], 'f')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2684
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2685 " Cannot specify both a non-empty list argument and a dict argument
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2686 call assert_fails("call g:Xsetlist([{}], ' ', {})", 'E475:')
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2687 endfunc
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
2688
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2689 func Test_qf_property()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2690 call Xproperty_tests('c')
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
2691 call Xproperty_tests('l')
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2692 endfunc
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2693
15424
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2694 " Test for setting the current index in the location/quickfix list
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2695 func Xtest_setqfidx(cchar)
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2696 call s:setup_commands(a:cchar)
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2697
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2698 Xgetexpr "F1:10:1:Line1\nF2:20:2:Line2\nF3:30:3:Line3"
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2699 Xgetexpr "F4:10:1:Line1\nF5:20:2:Line2\nF6:30:3:Line3"
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2700 Xgetexpr "F7:10:1:Line1\nF8:20:2:Line2\nF9:30:3:Line3"
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2701
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2702 call g:Xsetlist([], 'a', {'nr' : 3, 'idx' : 2})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2703 call g:Xsetlist([], 'a', {'nr' : 2, 'idx' : 2})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2704 call g:Xsetlist([], 'a', {'nr' : 1, 'idx' : 3})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2705 Xolder 2
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2706 Xopen
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2707 call assert_equal(3, line('.'))
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2708 Xnewer
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2709 call assert_equal(2, line('.'))
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2710 Xnewer
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2711 call assert_equal(2, line('.'))
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2712 " Update the current index with the quickfix window open
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2713 wincmd w
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2714 call g:Xsetlist([], 'a', {'nr' : 3, 'idx' : 3})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2715 Xopen
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2716 call assert_equal(3, line('.'))
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2717 Xclose
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2718
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2719 " Set the current index to the last entry
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2720 call g:Xsetlist([], 'a', {'nr' : 1, 'idx' : '$'})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2721 call assert_equal(3, g:Xgetlist({'nr' : 1, 'idx' : 0}).idx)
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2722 " A large value should set the index to the last index
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2723 call g:Xsetlist([], 'a', {'nr' : 1, 'idx' : 1})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2724 call g:Xsetlist([], 'a', {'nr' : 1, 'idx' : 999})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2725 call assert_equal(3, g:Xgetlist({'nr' : 1, 'idx' : 0}).idx)
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2726 " Invalid index values
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2727 call g:Xsetlist([], 'a', {'nr' : 1, 'idx' : -1})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2728 call assert_equal(3, g:Xgetlist({'nr' : 1, 'idx' : 0}).idx)
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2729 call g:Xsetlist([], 'a', {'nr' : 1, 'idx' : 0})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2730 call assert_equal(3, g:Xgetlist({'nr' : 1, 'idx' : 0}).idx)
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2731 call g:Xsetlist([], 'a', {'nr' : 1, 'idx' : 'xx'})
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2732 call assert_equal(3, g:Xgetlist({'nr' : 1, 'idx' : 0}).idx)
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2733 call assert_fails("call g:Xsetlist([], 'a', {'nr':1, 'idx':[]})", 'E745:')
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2734
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2735 call g:Xsetlist([], 'f')
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2736 new | only
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2737 endfunc
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2738
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2739 func Test_setqfidx()
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2740 call Xtest_setqfidx('c')
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2741 call Xtest_setqfidx('l')
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2742 endfunc
90c8ff9c19ee patch 8.1.0720: cannot easily change the current quickfx list index
Bram Moolenaar <Bram@vim.org>
parents: 15225
diff changeset
2743
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2744 " Tests for the QuickFixCmdPre/QuickFixCmdPost autocommands
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2745 func QfAutoCmdHandler(loc, cmd)
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2746 call add(g:acmds, a:loc . a:cmd)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2747 endfunc
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2748
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2749 func Test_Autocmd()
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2750 autocmd QuickFixCmdPre * call QfAutoCmdHandler('pre', expand('<amatch>'))
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2751 autocmd QuickFixCmdPost * call QfAutoCmdHandler('post', expand('<amatch>'))
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2752
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2753 let g:acmds = []
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2754 cexpr "F1:10:Line 10"
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2755 caddexpr "F1:20:Line 20"
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2756 cgetexpr "F1:30:Line 30"
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2757 cexpr ""
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2758 caddexpr ""
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2759 cgetexpr ""
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2760 silent! cexpr non_existing_func()
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2761 silent! caddexpr non_existing_func()
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2762 silent! cgetexpr non_existing_func()
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2763 let l = ['precexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2764 \ 'postcexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2765 \ 'precaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2766 \ 'postcaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2767 \ 'precgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2768 \ 'postcgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2769 \ 'precexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2770 \ 'postcexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2771 \ 'precaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2772 \ 'postcaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2773 \ 'precgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2774 \ 'postcgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2775 \ 'precexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2776 \ 'precaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2777 \ 'precgetexpr']
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2778 call assert_equal(l, g:acmds)
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2779
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2780 let g:acmds = []
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2781 enew! | call append(0, "F2:10:Line 10")
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2782 cbuffer!
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2783 enew! | call append(0, "F2:20:Line 20")
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2784 cgetbuffer
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2785 enew! | call append(0, "F2:30:Line 30")
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2786 caddbuffer
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2787 new
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2788 let bnum = bufnr('%')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2789 bunload
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2790 exe 'silent! cbuffer! ' . bnum
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2791 exe 'silent! cgetbuffer ' . bnum
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2792 exe 'silent! caddbuffer ' . bnum
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2793 enew!
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2794 let l = ['precbuffer',
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2795 \ 'postcbuffer',
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2796 \ 'precgetbuffer',
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2797 \ 'postcgetbuffer',
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2798 \ 'precaddbuffer',
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2799 \ 'postcaddbuffer',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2800 \ 'precbuffer',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2801 \ 'precgetbuffer',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2802 \ 'precaddbuffer']
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2803 call assert_equal(l, g:acmds)
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2804
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2805 call writefile(['Xtest:1:Line1'], 'Xtest')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2806 call writefile([], 'Xempty')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2807 let g:acmds = []
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2808 cfile Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2809 caddfile Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2810 cgetfile Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2811 cfile Xempty
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2812 caddfile Xempty
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2813 cgetfile Xempty
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2814 silent! cfile do_not_exist
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2815 silent! caddfile do_not_exist
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2816 silent! cgetfile do_not_exist
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2817 let l = ['precfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2818 \ 'postcfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2819 \ 'precaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2820 \ 'postcaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2821 \ 'precgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2822 \ 'postcgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2823 \ 'precfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2824 \ 'postcfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2825 \ 'precaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2826 \ 'postcaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2827 \ 'precgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2828 \ 'postcgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2829 \ 'precfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2830 \ 'postcfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2831 \ 'precaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2832 \ 'postcaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2833 \ 'precgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2834 \ 'postcgetfile']
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2835 call assert_equal(l, g:acmds)
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2836
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2837 let g:acmds = []
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2838 helpgrep quickfix
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2839 silent! helpgrep non_existing_help_topic
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2840 vimgrep test Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2841 vimgrepadd test Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2842 silent! vimgrep non_existing_test Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2843 silent! vimgrepadd non_existing_test Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2844 set makeprg=
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2845 silent! make
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2846 set makeprg&
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2847 let l = ['prehelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2848 \ 'posthelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2849 \ 'prehelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2850 \ 'posthelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2851 \ 'previmgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2852 \ 'postvimgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2853 \ 'previmgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2854 \ 'postvimgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2855 \ 'previmgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2856 \ 'postvimgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2857 \ 'previmgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2858 \ 'postvimgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2859 \ 'premake',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2860 \ 'postmake']
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2861 call assert_equal(l, g:acmds)
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2862
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2863 if has('unix')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2864 " Run this test only on Unix-like systems. The grepprg may not be set on
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2865 " non-Unix systems.
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2866 " The following lines are used for the grep test. Don't remove.
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2867 " Grep_Autocmd_Text: Match 1
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2868 " GrepAdd_Autocmd_Text: Match 2
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2869 let g:acmds = []
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2870 silent grep Grep_Autocmd_Text test_quickfix.vim
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2871 silent grepadd GrepAdd_Autocmd_Text test_quickfix.vim
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2872 silent grep abc123def Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2873 silent grepadd abc123def Xtest
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2874 set grepprg=internal
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2875 silent grep Grep_Autocmd_Text test_quickfix.vim
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2876 silent grepadd GrepAdd_Autocmd_Text test_quickfix.vim
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2877 silent lgrep Grep_Autocmd_Text test_quickfix.vim
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2878 silent lgrepadd GrepAdd_Autocmd_Text test_quickfix.vim
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2879 set grepprg&vim
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2880 let l = ['pregrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2881 \ 'postgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2882 \ 'pregrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2883 \ 'postgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2884 \ 'pregrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2885 \ 'postgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2886 \ 'pregrepadd',
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2887 \ 'postgrepadd',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2888 \ 'pregrep',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2889 \ 'postgrep',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2890 \ 'pregrepadd',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2891 \ 'postgrepadd',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2892 \ 'prelgrep',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2893 \ 'postlgrep',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2894 \ 'prelgrepadd',
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
2895 \ 'postlgrepadd']
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2896 call assert_equal(l, g:acmds)
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2897 endif
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2898
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2899 call delete('Xtest')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2900 call delete('Xempty')
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
2901 au! QuickFixCmdPre
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
2902 au! QuickFixCmdPost
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2903 endfunc
10346
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2904
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2905 func Test_Autocmd_Exception()
10346
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2906 set efm=%m
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2907 lgetexpr '?'
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2908
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2909 try
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2910 call DoesNotExit()
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2911 catch
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2912 lgetexpr '1'
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2913 finally
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2914 lgetexpr '1'
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2915 endtry
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2916
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2917 call assert_equal('1', getloclist(0)[0].text)
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2918
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2919 set efm&vim
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2920 endfunc
10367
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2921
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2922 func Test_caddbuffer_wrong()
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2923 " This used to cause a memory access in freed memory.
10367
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2924 let save_efm = &efm
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2925 set efm=%EEEE%m,%WWWW,%+CCCC%>%#,%GGGG%.#
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2926 cgetexpr ['WWWW', 'EEEE', 'CCCC']
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2927 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2928 caddbuffer
10367
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2929 bwipe!
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2930 endfunc
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2931
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2932 func Test_caddexpr_wrong()
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2933 " This used to cause a memory access in freed memory.
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2934 cbuffer
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2935 cbuffer
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2936 copen
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2937 let save_efm = &efm
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2938 set efm=%
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2939 call assert_fails('caddexpr ""', 'E376:')
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2940 let &efm = save_efm
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2941 endfunc
10379
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2942
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2943 func Test_dirstack_cleanup()
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2944 " This used to cause a memory access in freed memory.
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2945 let save_efm = &efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2946 lexpr '0'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2947 lopen
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2948 fun X(c)
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2949 let save_efm=&efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2950 set efm=%D%f
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2951 if a:c == 'c'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2952 caddexpr '::'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2953 else
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2954 laddexpr ':0:0'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2955 endif
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2956 let &efm=save_efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2957 endfun
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2958 call X('c')
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2959 call X('l')
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2960 call setqflist([], 'r')
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2961 caddbuffer
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2962 let &efm = save_efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2963 endfunc
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2964
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2965 " Tests for jumping to entries from the location list window and quickfix
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2966 " window
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2967 func Test_cwindow_jump()
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2968 set efm=%f%%%l%%%m
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2969 lgetexpr ["F1%10%Line 10", "F2%20%Line 20", "F3%30%Line 30"]
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2970 lopen | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2971 lfirst
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2972 call assert_true(winnr('$') == 2)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2973 call assert_true(winnr() == 1)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2974 " Location list for the new window should be set
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2975 call assert_true(getloclist(0)[2].text == 'Line 30')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2976
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2977 " Open a scratch buffer
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2978 " Open a new window and create a location list
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2979 " Open the location list window and close the other window
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2980 " Jump to an entry.
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
2981 " Should create a new window and jump to the entry. The scratch buffer
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2982 " should not be used.
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2983 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2984 set buftype=nofile
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2985 below new
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2986 lgetexpr ["F1%10%Line 10", "F2%20%Line 20", "F3%30%Line 30"]
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2987 lopen
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2988 2wincmd c
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2989 lnext
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2990 call assert_true(winnr('$') == 3)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2991 call assert_true(winnr() == 2)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2992
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2993 " Open two windows with two different location lists
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2994 " Open the location list window and close the previous window
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2995 " Jump to an entry in the location list window
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2996 " Should open the file in the first window and not set the location list.
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2997 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2998 lgetexpr ["F1%5%Line 5"]
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2999 below new
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3000 lgetexpr ["F1%10%Line 10", "F2%20%Line 20", "F3%30%Line 30"]
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3001 lopen
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3002 2wincmd c
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3003 lnext
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3004 call assert_true(winnr() == 1)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3005 call assert_true(getloclist(0)[0].text == 'Line 5')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3006
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3007 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3008 cgetexpr ["F1%10%Line 10", "F2%20%Line 20", "F3%30%Line 30"]
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3009 copen
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3010 cnext
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3011 call assert_true(winnr('$') == 2)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3012 call assert_true(winnr() == 1)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3013
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3014 " open the quickfix buffer in two windows and jump to an entry. Should open
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3015 " the file in the first quickfix window.
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3016 enew | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3017 copen
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3018 let bnum = bufnr('')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3019 exe 'sbuffer ' . bnum
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3020 wincmd b
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3021 cfirst
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3022 call assert_equal(2, winnr())
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
3023 call assert_equal('F1', @%)
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3024 enew | only
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3025 exe 'sb' bnum
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3026 exe 'botright sb' bnum
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3027 wincmd t
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3028 clast
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3029 call assert_equal(2, winnr())
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3030 call assert_equal('quickfix', getwinvar(1, '&buftype'))
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3031 call assert_equal('quickfix', getwinvar(3, '&buftype'))
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3032
19195
2ef19eed524a patch 8.2.0156: various typos in source files and tests
Bram Moolenaar <Bram@vim.org>
parents: 19069
diff changeset
3033 " Jumping to a file from the location list window should find a usable
18740
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3034 " window by wrapping around the window list.
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3035 enew | only
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3036 call setloclist(0, [], 'f')
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3037 new | new
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3038 lgetexpr ["F1%10%Line 10", "F2%20%Line 20", "F3%30%Line 30"]
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3039 lopen
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3040 1close
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3041 call assert_equal(0, getloclist(3, {'id' : 0}).id)
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3042 lnext
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3043 call assert_equal(3, winnr())
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3044 call assert_equal(getloclist(1, {'id' : 0}).id, getloclist(3, {'id' : 0}).id)
d23bb26ba98f patch 8.1.2360: quickfix test coverage can still be improved
Bram Moolenaar <Bram@vim.org>
parents: 18736
diff changeset
3045
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3046 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3047 set efm&vim
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
3048 endfunc
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3049
18090
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3050 func Test_cwindow_highlight()
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3051 CheckScreendump
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3052
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3053 let lines =<< trim END
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3054 call setline(1, ['some', 'text', 'with', 'matches'])
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3055 write XCwindow
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3056 vimgrep e XCwindow
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3057 redraw
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3058 cwindow 4
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3059 END
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3060 call writefile(lines, 'XtestCwindow')
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3061 let buf = RunVimInTerminal('-S XtestCwindow', #{rows: 12})
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3062 call VerifyScreenDump(buf, 'Test_quickfix_cwindow_1', {})
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3063
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3064 call term_sendkeys(buf, ":cnext\<CR>")
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3065 call VerifyScreenDump(buf, 'Test_quickfix_cwindow_2', {})
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3066
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3067 " clean up
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3068 call StopVimInTerminal(buf)
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3069 call delete('XtestCwindow')
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3070 call delete('XCwindow')
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3071 endfunc
a6c74689fb97 patch 8.1.2040: no highlighting of current line in quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 18031
diff changeset
3072
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3073 func XvimgrepTests(cchar)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3074 call s:setup_commands(a:cchar)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3075
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3076 call writefile(['Editor:VIM vim',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3077 \ 'Editor:Emacs EmAcS',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3078 \ 'Editor:Notepad NOTEPAD'], 'Xtestfile1')
26211
485c7c4afeb7 patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents: 26026
diff changeset
3079 call writefile(['Linux', 'macOS', 'MS-Windows'], 'Xtestfile2')
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3080
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3081 " Error cases
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3082 call assert_fails('Xvimgrep /abc *', 'E682:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3083
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3084 let @/=''
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3085 call assert_fails('Xvimgrep // *', 'E35:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3086
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3087 call assert_fails('Xvimgrep abc', 'E683:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3088 call assert_fails('Xvimgrep a1b2c3 Xtestfile1', 'E480:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3089 call assert_fails('Xvimgrep pat Xa1b2c3', 'E480:')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3090
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3091 Xexpr ""
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3092 Xvimgrepadd Notepad Xtestfile1
26211
485c7c4afeb7 patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents: 26026
diff changeset
3093 Xvimgrepadd macOS Xtestfile2
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3094 let l = g:Xgetlist()
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3095 call assert_equal(2, len(l))
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3096 call assert_equal('Editor:Notepad NOTEPAD', l[0].text)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3097
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
3098 10Xvimgrep #\cvim#g Xtestfile?
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3099 let l = g:Xgetlist()
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3100 call assert_equal(2, len(l))
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3101 call assert_equal(8, l[0].col)
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
3102 call assert_equal(11, l[0].end_col)
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3103 call assert_equal(12, l[1].col)
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
3104 call assert_equal(15, l[1].end_col)
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3105
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3106 1Xvimgrep ?Editor? Xtestfile*
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3107 let l = g:Xgetlist()
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3108 call assert_equal(1, len(l))
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3109 call assert_equal('Editor:VIM vim', l[0].text)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3110
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3111 edit +3 Xtestfile2
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3112 Xvimgrep +\cemacs+j Xtestfile1
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3113 let l = g:Xgetlist()
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
3114 call assert_equal('Xtestfile2', @%)
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3115 call assert_equal('Editor:Emacs EmAcS', l[0].text)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3116
13764
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
3117 " Test for unloading a buffer after vimgrep searched the buffer
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
3118 %bwipe
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
3119 Xvimgrep /Editor/j Xtestfile*
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
3120 call assert_equal(0, getbufinfo('Xtestfile1')[0].loaded)
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
3121 call assert_equal([], getbufinfo('Xtestfile2'))
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
3122
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3123 " Test for opening the dummy buffer used by vimgrep in a window. The new
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3124 " window should be closed
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3125 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3126 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3127 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3128 autocmd BufReadPre * exe "sb " .. expand("<abuf>")
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3129 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3130 call assert_fails("Xvimgrep /sublime/ Xtestfile1", 'E480:')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3131 call assert_equal(1, winnr('$'))
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3132 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3133 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3134 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
3135
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3136 call delete('Xtestfile1')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3137 call delete('Xtestfile2')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3138 endfunc
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3139
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3140 " Tests for the :vimgrep command
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3141 func Test_vimgrep()
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3142 call XvimgrepTests('c')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3143 call XvimgrepTests('l')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
3144 endfunc
11301
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3145
23778
8b682f6f3709 patch 8.2.2430: :vimgrep expands wildcards twice
Bram Moolenaar <Bram@vim.org>
parents: 23758
diff changeset
3146 func Test_vimgrep_wildcards_expanded_once()
8b682f6f3709 patch 8.2.2430: :vimgrep expands wildcards twice
Bram Moolenaar <Bram@vim.org>
parents: 23758
diff changeset
3147 new X[id-01] file.txt
8b682f6f3709 patch 8.2.2430: :vimgrep expands wildcards twice
Bram Moolenaar <Bram@vim.org>
parents: 23758
diff changeset
3148 call setline(1, 'some text to search for')
8b682f6f3709 patch 8.2.2430: :vimgrep expands wildcards twice
Bram Moolenaar <Bram@vim.org>
parents: 23758
diff changeset
3149 vimgrep text %
8b682f6f3709 patch 8.2.2430: :vimgrep expands wildcards twice
Bram Moolenaar <Bram@vim.org>
parents: 23758
diff changeset
3150 bwipe!
8b682f6f3709 patch 8.2.2430: :vimgrep expands wildcards twice
Bram Moolenaar <Bram@vim.org>
parents: 23758
diff changeset
3151 endfunc
8b682f6f3709 patch 8.2.2430: :vimgrep expands wildcards twice
Bram Moolenaar <Bram@vim.org>
parents: 23758
diff changeset
3152
14976
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3153 " Test for incsearch highlighting of the :vimgrep pattern
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3154 " This test used to cause "E315: ml_get: invalid lnum" errors.
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3155 func Test_vimgrep_incsearch()
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3156 enew
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3157 set incsearch
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3158 call test_override("char_avail", 1)
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3159
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3160 call feedkeys(":2vimgrep assert test_quickfix.vim test_cdo.vim\<CR>", "ntx")
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3161 let l = getqflist()
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3162 call assert_equal(2, len(l))
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3163
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3164 call test_override("ALL", 0)
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3165 set noincsearch
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3166 endfunc
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
3167
19370
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3168 " Test vimgrep with the last search pattern not set
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3169 func Test_vimgrep_with_no_last_search_pat()
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3170 let lines =<< trim [SCRIPT]
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3171 call assert_fails('vimgrep // *', 'E35:')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3172 call writefile(v:errors, 'Xresult')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3173 qall!
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3174 [SCRIPT]
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3175 call writefile(lines, 'Xscript')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3176 if RunVim([], [], '--clean -S Xscript')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3177 call assert_equal([], readfile('Xresult'))
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3178 endif
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3179 call delete('Xscript')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3180 call delete('Xresult')
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3181 endfunc
02111977dd05 patch 8.2.0243: insufficient code coverage for ex_docmd.c functions
Bram Moolenaar <Bram@vim.org>
parents: 19366
diff changeset
3182
22015
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3183 " Test vimgrep without swap file
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3184 func Test_vimgrep_without_swap_file()
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3185 let lines =<< trim [SCRIPT]
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3186 vimgrep grep test_c*
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3187 call writefile(['done'], 'Xresult')
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3188 qall!
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3189 [SCRIPT]
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3190 call writefile(lines, 'Xscript')
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3191 if RunVim([], [], '--clean -n -S Xscript Xscript')
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3192 call assert_equal(['done'], readfile('Xresult'))
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3193 endif
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3194 call delete('Xscript')
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3195 call delete('Xresult')
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3196 endfunc
d8065205ea82 patch 8.2.1557: crash in :vimgrep when started as "vim -n"
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
3197
21668
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3198 func Test_vimgrep_existing_swapfile()
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3199 call writefile(['match apple with apple'], 'Xapple')
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3200 call writefile(['swapfile'], '.Xapple.swp')
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3201 let g:foundSwap = 0
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3202 let g:ignoreSwapExists = 1
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3203 augroup grep
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3204 au SwapExists * let foundSwap = 1 | let v:swapchoice = 'e'
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3205 augroup END
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3206 vimgrep apple Xapple
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3207 call assert_equal(1, g:foundSwap)
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3208 call assert_match('.Xapple.swo', swapname(''))
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3209
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3210 call delete('Xapple')
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3211 call delete('.Xapple.swp')
21668
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3212 augroup grep
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3213 au! SwapExists
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3214 augroup END
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3215 unlet g:ignoreSwapExists
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3216 endfunc
0843f244e547 patch 8.2.1384: no ATTENTION prompt for :vimgrep first match file
Bram Moolenaar <Bram@vim.org>
parents: 21409
diff changeset
3217
11301
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3218 func XfreeTests(cchar)
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3219 call s:setup_commands(a:cchar)
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3220
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3221 enew | only
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3222
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3223 " Deleting the quickfix stack should work even When the current list is
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3224 " somewhere in the middle of the stack
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3225 Xexpr ['Xfile1:10:10:Line 10', 'Xfile1:15:15:Line 15']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3226 Xexpr ['Xfile2:20:20:Line 20', 'Xfile2:25:25:Line 25']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3227 Xexpr ['Xfile3:30:30:Line 30', 'Xfile3:35:35:Line 35']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3228 Xolder
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3229 call g:Xsetlist([], 'f')
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3230 call assert_equal(0, len(g:Xgetlist()))
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3231
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3232 " After deleting the stack, adding a new list should create a stack with a
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3233 " single list.
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3234 Xexpr ['Xfile1:10:10:Line 10', 'Xfile1:15:15:Line 15']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3235 call assert_equal(1, g:Xgetlist({'all':1}).nr)
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3236
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3237 " Deleting the stack from a quickfix window should update/clear the
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3238 " quickfix/location list window.
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3239 Xexpr ['Xfile1:10:10:Line 10', 'Xfile1:15:15:Line 15']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3240 Xexpr ['Xfile2:20:20:Line 20', 'Xfile2:25:25:Line 25']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3241 Xexpr ['Xfile3:30:30:Line 30', 'Xfile3:35:35:Line 35']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3242 Xolder
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3243 Xwindow
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3244 call g:Xsetlist([], 'f')
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3245 call assert_equal(2, winnr('$'))
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3246 call assert_equal(1, line('$'))
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3247 Xclose
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3248
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3249 " Deleting the stack from a non-quickfix window should update/clear the
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3250 " quickfix/location list window.
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3251 Xexpr ['Xfile1:10:10:Line 10', 'Xfile1:15:15:Line 15']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3252 Xexpr ['Xfile2:20:20:Line 20', 'Xfile2:25:25:Line 25']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3253 Xexpr ['Xfile3:30:30:Line 30', 'Xfile3:35:35:Line 35']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3254 Xolder
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3255 Xwindow
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3256 wincmd p
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3257 call g:Xsetlist([], 'f')
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3258 call assert_equal(0, len(g:Xgetlist()))
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3259 wincmd p
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3260 call assert_equal(2, winnr('$'))
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3261 call assert_equal(1, line('$'))
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3262
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3263 " After deleting the location list stack, if the location list window is
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3264 " opened, then a new location list should be created. So opening the
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3265 " location list window again should not create a new window.
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3266 if a:cchar == 'l'
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3267 lexpr ['Xfile1:10:10:Line 10', 'Xfile1:15:15:Line 15']
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3268 wincmd p
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3269 lopen
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3270 call assert_equal(2, winnr('$'))
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3271 endif
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3272 Xclose
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3273 endfunc
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3274
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3275 " Tests for the quickfix free functionality
11301
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3276 func Test_qf_free()
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3277 call XfreeTests('c')
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3278 call XfreeTests('l')
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
3279 endfunc
11445
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3280
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3281 " Test for buffer overflow when parsing lines and adding new entries to
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3282 " the quickfix list.
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3283 func Test_bufoverflow()
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3284 set efm=%f:%l:%m
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3285 cgetexpr ['File1:100:' . repeat('x', 1025)]
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3286
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3287 set efm=%+GCompiler:\ %.%#,%f:%l:%m
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3288 cgetexpr ['Compiler: ' . repeat('a', 1015), 'File1:10:Hello World']
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3289
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3290 set efm=%DEntering\ directory\ %f,%f:%l:%m
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3291 cgetexpr ['Entering directory ' . repeat('a', 1006),
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3292 \ 'File1:10:Hello World']
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3293 set efm&vim
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3294 endfunc
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
3295
11502
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3296 " Tests for getting the quickfix stack size
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3297 func XsizeTests(cchar)
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3298 call s:setup_commands(a:cchar)
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3299
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3300 call g:Xsetlist([], 'f')
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3301 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr)
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3302 call assert_equal('', g:Xgetlist({'nr':'$', 'all':1}).title)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3303 call assert_equal(0, g:Xgetlist({'nr':0}).nr)
11502
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3304
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3305 Xexpr "File1:10:Line1"
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3306 Xexpr "File2:20:Line2"
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3307 Xexpr "File3:30:Line3"
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3308 Xolder | Xolder
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3309 call assert_equal(3, g:Xgetlist({'nr':'$'}).nr)
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3310 call g:Xsetlist([], 'f')
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3311
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3312 Xexpr "File1:10:Line1"
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3313 Xexpr "File2:20:Line2"
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3314 Xexpr "File3:30:Line3"
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3315 Xolder | Xolder
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3316 call g:Xsetlist([], 'a', {'nr':'$', 'title':'Compiler'})
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3317 call assert_equal('Compiler', g:Xgetlist({'nr':3, 'all':1}).title)
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3318 endfunc
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3319
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3320 func Test_Qf_Size()
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3321 call XsizeTests('c')
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3322 call XsizeTests('l')
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
3323 endfunc
11589
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3324
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3325 func Test_cclose_from_copen()
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3326 augroup QF_Test
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3327 au!
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
3328 au FileType qf :call assert_fails(':cclose', 'E788:')
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3329 augroup END
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3330 copen
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3331 augroup QF_Test
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3332 au!
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3333 augroup END
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3334 augroup! QF_Test
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3335 endfunc
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3336
11589
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3337 func Test_cclose_in_autocmd()
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3338 " Problem is only triggered if "starting" is zero, so that the OptionsSet
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3339 " event will be triggered.
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3340 call test_override('starting', 1)
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3341 augroup QF_Test
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3342 au!
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
3343 au FileType qf :call assert_fails(':cclose', 'E788:')
11589
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3344 augroup END
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3345 copen
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3346 augroup QF_Test
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3347 au!
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3348 augroup END
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3349 augroup! QF_Test
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3350 call test_override('starting', 0)
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
3351 endfunc
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3352
14648
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3353 " Check that ":file" without an argument is possible even when "curbuf_lock"
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3354 " is set.
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3355 func Test_file_from_copen()
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3356 " Works without argument.
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3357 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3358 au!
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3359 au FileType qf file
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3360 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3361 copen
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3362
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3363 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3364 au!
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3365 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3366 cclose
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3367
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3368 " Fails with argument.
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3369 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3370 au!
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
3371 au FileType qf call assert_fails(':file foo', 'E788:')
14648
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3372 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3373 copen
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3374 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3375 au!
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3376 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3377 cclose
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3378
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3379 augroup! QF_Test
18452
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
3380 endfunc
14648
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
3381
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3382 func Test_resize_from_copen()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3383 augroup QF_Test
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3384 au!
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3385 au FileType qf resize 5
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3386 augroup END
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3387 try
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3388 " This should succeed without any exception. No other buffers are
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3389 " involved in the autocmd.
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3390 copen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3391 finally
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3392 augroup QF_Test
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3393 au!
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3394 augroup END
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3395 augroup! QF_Test
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3396 endtry
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
3397 endfunc
11705
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3398
22874
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3399 func Test_vimgrep_with_textlock()
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3400 new
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3401
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3402 " Simple way to execute something with "textwinlock" set.
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3403 " Check that vimgrep without jumping can be executed.
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3404 au InsertCharPre * vimgrep /RunTheTest/j runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3405 normal ax
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3406 let qflist = getqflist()
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3407 call assert_true(len(qflist) > 0)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3408 call assert_match('RunTheTest', qflist[0].text)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3409 call setqflist([], 'r')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3410 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3411
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3412 " Check that vimgrepadd without jumping can be executed.
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3413 au InsertCharPre * vimgrepadd /RunTheTest/j runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3414 normal ax
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3415 let qflist = getqflist()
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3416 call assert_true(len(qflist) > 0)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3417 call assert_match('RunTheTest', qflist[0].text)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3418 call setqflist([], 'r')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3419 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3420
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3421 " Check that lvimgrep without jumping can be executed.
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3422 au InsertCharPre * lvimgrep /RunTheTest/j runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3423 normal ax
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3424 let qflist = getloclist(0)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3425 call assert_true(len(qflist) > 0)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3426 call assert_match('RunTheTest', qflist[0].text)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3427 call setloclist(0, [], 'r')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3428 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3429
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3430 " Check that lvimgrepadd without jumping can be executed.
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3431 au InsertCharPre * lvimgrepadd /RunTheTest/j runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3432 normal ax
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3433 let qflist = getloclist(0)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3434 call assert_true(len(qflist) > 0)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3435 call assert_match('RunTheTest', qflist[0].text)
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3436 call setloclist(0, [], 'r')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3437 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3438
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3439 " trying to jump will give an error
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3440 au InsertCharPre * vimgrep /RunTheTest/ runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3441 call assert_fails('normal ax', 'E565:')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3442 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3443
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3444 au InsertCharPre * vimgrepadd /RunTheTest/ runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3445 call assert_fails('normal ax', 'E565:')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3446 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3447
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3448 au InsertCharPre * lvimgrep /RunTheTest/ runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3449 call assert_fails('normal ax', 'E565:')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3450 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3451
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3452 au InsertCharPre * lvimgrepadd /RunTheTest/ runtest.vim
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3453 call assert_fails('normal ax', 'E565:')
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3454 au! InsertCharPre
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3455
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3456 bwipe!
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3457 endfunc
db1bc1ab5ec8 patch 8.2.1984: cannot use :vimgrep in omni completion
Bram Moolenaar <Bram@vim.org>
parents: 22870
diff changeset
3458
11705
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3459 " Tests for the quickfix buffer b:changedtick variable
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3460 func Xchangedtick_tests(cchar)
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3461 call s:setup_commands(a:cchar)
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3462
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3463 new | only
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3464
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3465 Xexpr "" | Xexpr "" | Xexpr ""
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3466
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3467 Xopen
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3468 Xolder
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3469 Xolder
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3470 Xaddexpr "F1:10:Line10"
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3471 Xaddexpr "F2:20:Line20"
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3472 call g:Xsetlist([{"filename":"F3", "lnum":30, "text":"Line30"}], 'a')
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3473 call g:Xsetlist([], 'f')
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3474 call assert_equal(8, getbufvar('%', 'changedtick'))
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3475 Xclose
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3476 endfunc
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3477
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3478 func Test_changedtick()
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3479 call Xchangedtick_tests('c')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3480 call Xchangedtick_tests('l')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3481 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3482
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3483 " Tests for parsing an expression using setqflist()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3484 func Xsetexpr_tests(cchar)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3485 call s:setup_commands(a:cchar)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3486
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3487 let t = ["File1:10:Line10", "File1:20:Line20"]
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3488 call g:Xsetlist([], ' ', {'lines' : t})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3489 call g:Xsetlist([], 'a', {'lines' : ["File1:30:Line30"]})
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3490
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3491 let l = g:Xgetlist()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3492 call assert_equal(3, len(l))
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3493 call assert_equal(20, l[1].lnum)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3494 call assert_equal('Line30', l[2].text)
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3495 call g:Xsetlist([], 'r', {'lines' : ["File2:5:Line5"]})
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3496 let l = g:Xgetlist()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3497 call assert_equal(1, len(l))
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3498 call assert_equal('Line5', l[0].text)
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3499 call assert_equal(-1, g:Xsetlist([], 'a', {'lines' : 10}))
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3500 call assert_equal(-1, g:Xsetlist([], 'a', {'lines' : "F1:10:L10"}))
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3501
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3502 call g:Xsetlist([], 'f')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3503 " Add entries to multiple lists
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3504 call g:Xsetlist([], 'a', {'nr' : 1, 'lines' : ["File1:10:Line10"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3505 call g:Xsetlist([], 'a', {'nr' : 2, 'lines' : ["File2:20:Line20"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3506 call g:Xsetlist([], 'a', {'nr' : 1, 'lines' : ["File1:15:Line15"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3507 call g:Xsetlist([], 'a', {'nr' : 2, 'lines' : ["File2:25:Line25"]})
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3508 call assert_equal('Line15', g:Xgetlist({'nr':1, 'items':1}).items[1].text)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3509 call assert_equal('Line25', g:Xgetlist({'nr':2, 'items':1}).items[1].text)
12321
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3510
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3511 " Adding entries using a custom efm
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3512 set efm&
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3513 call g:Xsetlist([], ' ', {'efm' : '%f#%l#%m',
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3514 \ 'lines' : ["F1#10#L10", "F2#20#L20"]})
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3515 call assert_equal(20, g:Xgetlist({'items':1}).items[1].lnum)
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3516 call g:Xsetlist([], 'a', {'efm' : '%f#%l#%m', 'lines' : ["F3:30:L30"]})
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3517 call assert_equal('F3:30:L30', g:Xgetlist({'items':1}).items[2].text)
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3518 call assert_equal(20, g:Xgetlist({'items':1}).items[1].lnum)
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3519 call assert_equal(-1, g:Xsetlist([], 'a', {'efm' : [],
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3520 \ 'lines' : ['F1:10:L10']}))
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3521 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3522
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3523 func Test_setexpr()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3524 call Xsetexpr_tests('c')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3525 call Xsetexpr_tests('l')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3526 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3527
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3528 " Tests for per quickfix/location list directory stack
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3529 func Xmultidirstack_tests(cchar)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3530 call s:setup_commands(a:cchar)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3531
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3532 call g:Xsetlist([], 'f')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3533 Xexpr "" | Xexpr ""
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3534
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3535 call g:Xsetlist([], 'a', {'nr' : 1, 'lines' : ["Entering dir 'Xone/a'"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3536 call g:Xsetlist([], 'a', {'nr' : 2, 'lines' : ["Entering dir 'Xtwo/a'"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3537 call g:Xsetlist([], 'a', {'nr' : 1, 'lines' : ["one.txt:3:one one one"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3538 call g:Xsetlist([], 'a', {'nr' : 2, 'lines' : ["two.txt:5:two two two"]})
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3539
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3540 let l1 = g:Xgetlist({'nr':1, 'items':1})
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3541 let l2 = g:Xgetlist({'nr':2, 'items':1})
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3542 call assert_equal('Xone/a/one.txt', bufname(l1.items[1].bufnr))
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3543 call assert_equal(3, l1.items[1].lnum)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3544 call assert_equal('Xtwo/a/two.txt', bufname(l2.items[1].bufnr))
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3545 call assert_equal(5, l2.items[1].lnum)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3546 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3547
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3548 func Test_multidirstack()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3549 call mkdir('Xone/a', 'p')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3550 call mkdir('Xtwo/a', 'p')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3551 let lines = ['1', '2', 'one one one', '4', 'two two two', '6', '7']
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3552 call writefile(lines, 'Xone/a/one.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3553 call writefile(lines, 'Xtwo/a/two.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3554 let save_efm = &efm
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3555 set efm=%DEntering\ dir\ '%f',%f:%l:%m,%XLeaving\ dir\ '%f'
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3556
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3557 call Xmultidirstack_tests('c')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3558 call Xmultidirstack_tests('l')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3559
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3560 let &efm = save_efm
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3561 call delete('Xone', 'rf')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3562 call delete('Xtwo', 'rf')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3563 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3564
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3565 " Tests for per quickfix/location list file stack
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3566 func Xmultifilestack_tests(cchar)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3567 call s:setup_commands(a:cchar)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3568
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3569 call g:Xsetlist([], 'f')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3570 Xexpr "" | Xexpr ""
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3571
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3572 call g:Xsetlist([], 'a', {'nr' : 1, 'lines' : ["[one.txt]"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3573 call g:Xsetlist([], 'a', {'nr' : 2, 'lines' : ["[two.txt]"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3574 call g:Xsetlist([], 'a', {'nr' : 1, 'lines' : ["(3,5) one one one"]})
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3575 call g:Xsetlist([], 'a', {'nr' : 2, 'lines' : ["(5,9) two two two"]})
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3576
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3577 let l1 = g:Xgetlist({'nr':1, 'items':1})
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3578 let l2 = g:Xgetlist({'nr':2, 'items':1})
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3579 call assert_equal('one.txt', bufname(l1.items[1].bufnr))
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3580 call assert_equal(3, l1.items[1].lnum)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3581 call assert_equal('two.txt', bufname(l2.items[1].bufnr))
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3582 call assert_equal(5, l2.items[1].lnum)
13612
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3583
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3584 " Test for start of a new error line in the same line where a previous
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3585 " error line ends with a file stack.
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3586 let efm_val = 'Error\ l%l\ in\ %f,'
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3587 let efm_val .= '%-P%>(%f%r,Error\ l%l\ in\ %m,%-Q)%r'
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3588 let l = g:Xgetlist({'lines' : [
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3589 \ '(one.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3590 \ 'Error l4 in one.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3591 \ ') (two.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3592 \ 'Error l6 in two.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3593 \ ')',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3594 \ 'Error l8 in one.txt'
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3595 \ ], 'efm' : efm_val})
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3596 call assert_equal(3, len(l.items))
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3597 call assert_equal('one.txt', bufname(l.items[0].bufnr))
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3598 call assert_equal(4, l.items[0].lnum)
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3599 call assert_equal('one.txt', l.items[0].text)
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3600 call assert_equal('two.txt', bufname(l.items[1].bufnr))
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3601 call assert_equal(6, l.items[1].lnum)
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3602 call assert_equal('two.txt', l.items[1].text)
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3603 call assert_equal('one.txt', bufname(l.items[2].bufnr))
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3604 call assert_equal(8, l.items[2].lnum)
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
3605 call assert_equal('', l.items[2].text)
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3606 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3607
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3608 func Test_multifilestack()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3609 let lines = ['1', '2', 'one one one', '4', 'two two two', '6', '7']
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3610 call writefile(lines, 'one.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3611 call writefile(lines, 'two.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3612 let save_efm = &efm
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3613 set efm=%+P[%f],(%l\\,%c)\ %m,%-Q
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3614
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3615 call Xmultifilestack_tests('c')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3616 call Xmultifilestack_tests('l')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3617
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3618 let &efm = save_efm
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3619 call delete('one.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3620 call delete('two.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3621 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3622
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3623 " Tests for per buffer 'efm' setting
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3624 func Test_perbuf_efm()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3625 call writefile(["File1-10-Line10"], 'one.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3626 call writefile(["File2#20#Line20"], 'two.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3627 set efm=%f#%l#%m
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3628 new | only
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3629 new
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3630 setlocal efm=%f-%l-%m
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3631 cfile one.txt
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3632 wincmd w
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3633 caddfile two.txt
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3634
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3635 let l = getqflist()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3636 call assert_equal(10, l[0].lnum)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3637 call assert_equal('Line20', l[1].text)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3638
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3639 set efm&
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3640 new | only
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3641 call delete('one.txt')
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
3642 call delete('two.txt')
11705
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
3643 endfunc
11800
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
3644
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
3645 " Open multiple help windows using ":lhelpgrep
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
3646 " This test used to crash Vim
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
3647 func Test_Multi_LL_Help()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3648 new | only
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3649 lhelpgrep window
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3650 lopen
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3651 e#
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3652 lhelpgrep buffer
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3653 call assert_equal(3, winnr('$'))
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3654 call assert_true(len(getloclist(1)) != 0)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3655 call assert_true(len(getloclist(2)) != 0)
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
3656 new | only
11800
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
3657 endfunc
12084
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3658
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3659 " Tests for adding new quickfix lists using setqflist()
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3660 func XaddQf_tests(cchar)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3661 call s:setup_commands(a:cchar)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3662
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3663 " Create a new list using ' ' for action
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3664 call g:Xsetlist([], 'f')
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3665 call g:Xsetlist([], ' ', {'title' : 'Test1'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3666 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3667 call assert_equal(1, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3668 call assert_equal('Test1', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3669
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3670 " Create a new list using ' ' for action and '$' for 'nr'
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3671 call g:Xsetlist([], 'f')
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3672 call g:Xsetlist([], ' ', {'title' : 'Test2', 'nr' : '$'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3673 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3674 call assert_equal(1, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3675 call assert_equal('Test2', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3676
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3677 " Create a new list using 'a' for action
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3678 call g:Xsetlist([], 'f')
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3679 call g:Xsetlist([], 'a', {'title' : 'Test3'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3680 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3681 call assert_equal(1, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3682 call assert_equal('Test3', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3683
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3684 " Create a new list using 'a' for action and '$' for 'nr'
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3685 call g:Xsetlist([], 'f')
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3686 call g:Xsetlist([], 'a', {'title' : 'Test3', 'nr' : '$'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3687 call g:Xsetlist([], 'a', {'title' : 'Test4'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3688 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3689 call assert_equal(1, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3690 call assert_equal('Test4', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3691
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3692 " Adding a quickfix list should remove all the lists following the current
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3693 " list.
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3694 Xexpr "" | Xexpr "" | Xexpr ""
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3695 silent! 10Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3696 call g:Xsetlist([], ' ', {'title' : 'Test5'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3697 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3698 call assert_equal(2, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3699 call assert_equal('Test5', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3700
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3701 " Add a quickfix list using '$' as the list number.
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3702 let lastqf = g:Xgetlist({'nr':'$'}).nr
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3703 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3704 call g:Xsetlist([], ' ', {'nr' : '$', 'title' : 'Test6'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3705 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3706 call assert_equal(lastqf + 1, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3707 call assert_equal('Test6', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3708
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3709 " Add a quickfix list using 'nr' set to one more than the quickfix
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3710 " list size.
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3711 let lastqf = g:Xgetlist({'nr':'$'}).nr
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3712 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3713 call g:Xsetlist([], ' ', {'nr' : lastqf + 1, 'title' : 'Test7'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3714 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3715 call assert_equal(lastqf + 1, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3716 call assert_equal('Test7', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3717
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3718 " Add a quickfix list to a stack with 10 lists using 'nr' set to '$'
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3719 exe repeat('Xexpr "" |', 9) . 'Xexpr ""'
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3720 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3721 call g:Xsetlist([], ' ', {'nr' : '$', 'title' : 'Test8'})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3722 let l = g:Xgetlist({'nr' : '$', 'all' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3723 call assert_equal(10, l.nr)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3724 call assert_equal('Test8', l.title)
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3725
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3726 " Add a quickfix list using 'nr' set to a value greater than 10
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3727 call assert_equal(-1, g:Xsetlist([], ' ', {'nr' : 12, 'title' : 'Test9'}))
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3728
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3729 " Try adding a quickfix list with 'nr' set to a value greater than the
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3730 " quickfix list size but less than 10.
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3731 call g:Xsetlist([], 'f')
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3732 Xexpr "" | Xexpr "" | Xexpr ""
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3733 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3734 call assert_equal(-1, g:Xsetlist([], ' ', {'nr' : 8, 'title' : 'Test10'}))
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3735
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3736 " Add a quickfix list using 'nr' set to a some string or list
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3737 call assert_equal(-1, g:Xsetlist([], ' ', {'nr' : [1,2], 'title' : 'Test11'}))
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3738 endfunc
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3739
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3740 func Test_add_qf()
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3741 call XaddQf_tests('c')
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3742 call XaddQf_tests('l')
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
3743 endfunc
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3744
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3745 " Test for getting the quickfix list items from some text without modifying
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3746 " the quickfix stack
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3747 func XgetListFromLines(cchar)
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3748 call s:setup_commands(a:cchar)
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3749 call g:Xsetlist([], 'f')
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3750
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3751 let l = g:Xgetlist({'lines' : ["File2:20:Line20", "File2:30:Line30"]}).items
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3752 call assert_equal(2, len(l))
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3753 call assert_equal(30, l[1].lnum)
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3754
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3755 call assert_equal({}, g:Xgetlist({'lines' : 10}))
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3756 call assert_equal({}, g:Xgetlist({'lines' : 'File1:10:Line10'}))
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3757 call assert_equal([], g:Xgetlist({'lines' : []}).items)
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3758 call assert_equal([], g:Xgetlist({'lines' : [10, 20]}).items)
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3759
12321
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3760 " Parse text using a custom efm
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3761 set efm&
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3762 let l = g:Xgetlist({'lines':['File3#30#Line30'], 'efm' : '%f#%l#%m'}).items
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3763 call assert_equal('Line30', l[0].text)
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3764 let l = g:Xgetlist({'lines':['File3:30:Line30'], 'efm' : '%f-%l-%m'}).items
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3765 call assert_equal('File3:30:Line30', l[0].text)
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3766 let l = g:Xgetlist({'lines':['File3:30:Line30'], 'efm' : [1,2]})
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3767 call assert_equal({}, l)
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3768 call assert_fails("call g:Xgetlist({'lines':['abc'], 'efm':'%2'})", 'E376:')
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3769 call assert_fails("call g:Xgetlist({'lines':['abc'], 'efm':''})", 'E378:')
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
3770
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3771 " Make sure that the quickfix stack is not modified
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3772 call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3773 endfunc
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3774
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3775 func Test_get_list_from_lines()
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3776 call XgetListFromLines('c')
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3777 call XgetListFromLines('l')
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
3778 endfunc
12287
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3779
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3780 " Tests for the quickfix list id
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3781 func Xqfid_tests(cchar)
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3782 call s:setup_commands(a:cchar)
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3783
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3784 call g:Xsetlist([], 'f')
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3785 call assert_equal(0, g:Xgetlist({'id':0}).id)
12287
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3786 Xexpr ''
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3787 let start_id = g:Xgetlist({'id' : 0}).id
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3788 Xexpr '' | Xexpr ''
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3789 Xolder
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3790 call assert_equal(start_id, g:Xgetlist({'id':0, 'nr':1}).id)
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3791 call assert_equal(start_id + 1, g:Xgetlist({'id':0, 'nr':0}).id)
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3792 call assert_equal(start_id + 2, g:Xgetlist({'id':0, 'nr':'$'}).id)
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3793 call assert_equal(0, g:Xgetlist({'id':0, 'nr':99}).id)
12287
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3794 call assert_equal(2, g:Xgetlist({'id':start_id + 1, 'nr':0}).nr)
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3795 call assert_equal(0, g:Xgetlist({'id':99, 'nr':0}).id)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3796 call assert_equal(0, g:Xgetlist({'id':"abc", 'nr':0}).id)
12287
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3797
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3798 call g:Xsetlist([], 'a', {'id':start_id, 'context':[1,2]})
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3799 call assert_equal([1,2], g:Xgetlist({'nr':1, 'context':1}).context)
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
3800 call g:Xsetlist([], 'a', {'id':start_id+1, 'lines':['F1:10:L10']})
12287
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3801 call assert_equal('L10', g:Xgetlist({'nr':2, 'items':1}).items[0].text)
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3802 call assert_equal(-1, g:Xsetlist([], 'a', {'id':999, 'title':'Vim'}))
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3803 call assert_equal(-1, g:Xsetlist([], 'a', {'id':'abc', 'title':'Vim'}))
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3804
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3805 let qfid = g:Xgetlist({'id':0, 'nr':0})
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3806 call g:Xsetlist([], 'f')
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3807 call assert_equal(0, g:Xgetlist({'id':qfid, 'nr':0}).id)
12287
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3808 endfunc
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3809
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3810 func Test_qf_id()
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3811 call Xqfid_tests('c')
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3812 call Xqfid_tests('l')
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
3813 endfunc
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3814
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3815 func Xqfjump_tests(cchar)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3816 call s:setup_commands(a:cchar)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3817
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3818 call writefile(["Line1\tFoo", "Line2"], 'F1')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3819 call writefile(["Line1\tBar", "Line2"], 'F2')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3820 call writefile(["Line1\tBaz", "Line2"], 'F3')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3821
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3822 call g:Xsetlist([], 'f')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3823
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3824 " Tests for
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3825 " Jumping to a line using a pattern
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3826 " Jumping to a column greater than the last column in a line
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3827 " Jumping to a line greater than the last line in the file
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3828 let l = []
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3829 for i in range(1, 7)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3830 call add(l, {})
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3831 endfor
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3832 let l[0].filename='F1'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3833 let l[0].pattern='Line1'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3834 let l[1].filename='F2'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3835 let l[1].pattern='Line1'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3836 let l[2].filename='F3'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3837 let l[2].pattern='Line1'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3838 let l[3].filename='F3'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3839 let l[3].lnum=1
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3840 let l[3].col=9
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3841 let l[3].vcol=1
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3842 let l[4].filename='F3'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3843 let l[4].lnum=99
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3844 let l[5].filename='F3'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3845 let l[5].lnum=1
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3846 let l[5].col=99
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3847 let l[5].vcol=1
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3848 let l[6].filename='F3'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3849 let l[6].pattern='abcxyz'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3850
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3851 call g:Xsetlist([], ' ', {'items' : l})
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3852 Xopen | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3853 2Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3854 call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
3855 call assert_equal('F3', @%)
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3856 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3857 call assert_equal(7, col('.'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3858 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3859 call assert_equal(2, line('.'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3860 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3861 call assert_equal(9, col('.'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3862 2
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3863 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3864 call assert_equal(2, line('.'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3865
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3866 if a:cchar == 'l'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3867 " When jumping to a location list entry in the location list window and
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3868 " no usable windows are available, then a new window should be opened.
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3869 enew! | new | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3870 call g:Xsetlist([], 'f')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3871 setlocal buftype=nofile
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3872 new
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3873 call g:Xsetlist([], ' ', {'lines' : ['F1:1:1:Line1', 'F1:2:2:Line2', 'F2:1:1:Line1', 'F2:2:2:Line2', 'F3:1:1:Line1', 'F3:2:2:Line2']})
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3874 Xopen
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3875 let winid = win_getid()
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3876 wincmd p
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3877 close
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3878 call win_gotoid(winid)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3879 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3880 call assert_equal(3, winnr('$'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3881 call assert_equal(1, winnr())
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3882 call assert_equal(2, line('.'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3883
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3884 " When jumping to an entry in the location list window and the window
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3885 " associated with the location list is not present and a window containing
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3886 " the file is already present, then that window should be used.
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3887 close
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3888 belowright new
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3889 call g:Xsetlist([], 'f')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3890 edit F3
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3891 call win_gotoid(winid)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3892 Xlast
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3893 call assert_equal(3, winnr())
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3894 call assert_equal(6, g:Xgetlist({'size' : 1}).size)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3895 call assert_equal(winid, g:Xgetlist({'winid' : 1}).winid)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3896 endif
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3897
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3898 " Cleanup
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3899 enew!
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3900 new | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3901
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3902 call delete('F1')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3903 call delete('F2')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3904 call delete('F3')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3905 endfunc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3906
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3907 func Test_qfjump()
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3908 call Xqfjump_tests('c')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3909 call Xqfjump_tests('l')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3910 endfunc
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3911
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3912 " Tests for the getqflist() and getloclist() functions when the list is not
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3913 " present or is empty
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3914 func Xgetlist_empty_tests(cchar)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3915 call s:setup_commands(a:cchar)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3916
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3917 " Empty quickfix stack
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3918 call g:Xsetlist([], 'f')
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3919 call assert_equal('', g:Xgetlist({'context' : 0}).context)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3920 call assert_equal(0, g:Xgetlist({'id' : 0}).id)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3921 call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3922 call assert_equal([], g:Xgetlist({'items' : 0}).items)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3923 call assert_equal(0, g:Xgetlist({'nr' : 0}).nr)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3924 call assert_equal(0, g:Xgetlist({'size' : 0}).size)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3925 call assert_equal('', g:Xgetlist({'title' : 0}).title)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3926 call assert_equal(0, g:Xgetlist({'winid' : 0}).winid)
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3927 call assert_equal(0, g:Xgetlist({'changedtick' : 0}).changedtick)
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3928 if a:cchar == 'c'
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3929 call assert_equal({'context' : '', 'id' : 0, 'idx' : 0,
16019
096b8ccd855e patch 8.1.1015: quickfix buffer shows up in list, can't get buffer number
Bram Moolenaar <Bram@vim.org>
parents: 15965
diff changeset
3930 \ 'items' : [], 'nr' : 0, 'size' : 0, 'qfbufnr' : 0,
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3931 \ 'title' : '', 'winid' : 0, 'changedtick': 0,
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3932 \ 'quickfixtextfunc' : ''}, g:Xgetlist({'all' : 0}))
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3933 else
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3934 call assert_equal({'context' : '', 'id' : 0, 'idx' : 0,
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3935 \ 'items' : [], 'nr' : 0, 'size' : 0, 'title' : '',
16019
096b8ccd855e patch 8.1.1015: quickfix buffer shows up in list, can't get buffer number
Bram Moolenaar <Bram@vim.org>
parents: 15965
diff changeset
3936 \ 'winid' : 0, 'changedtick': 0, 'filewinid' : 0,
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3937 \ 'qfbufnr' : 0, 'quickfixtextfunc' : ''},
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3938 \ g:Xgetlist({'all' : 0}))
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3939 endif
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3940
13115
9812a9ca3ab2 patch 8.0.1432: after ":copen" can't get the window-ID of the quickfix window
Christian Brabandt <cb@256bit.org>
parents: 13105
diff changeset
3941 " Quickfix window with empty stack
9812a9ca3ab2 patch 8.0.1432: after ":copen" can't get the window-ID of the quickfix window
Christian Brabandt <cb@256bit.org>
parents: 13105
diff changeset
3942 silent! Xopen
9812a9ca3ab2 patch 8.0.1432: after ":copen" can't get the window-ID of the quickfix window
Christian Brabandt <cb@256bit.org>
parents: 13105
diff changeset
3943 let qfwinid = (a:cchar == 'c') ? win_getid() : 0
16019
096b8ccd855e patch 8.1.1015: quickfix buffer shows up in list, can't get buffer number
Bram Moolenaar <Bram@vim.org>
parents: 15965
diff changeset
3944 let qfbufnr = (a:cchar == 'c') ? bufnr('') : 0
13115
9812a9ca3ab2 patch 8.0.1432: after ":copen" can't get the window-ID of the quickfix window
Christian Brabandt <cb@256bit.org>
parents: 13105
diff changeset
3945 call assert_equal(qfwinid, g:Xgetlist({'winid' : 0}).winid)
9812a9ca3ab2 patch 8.0.1432: after ":copen" can't get the window-ID of the quickfix window
Christian Brabandt <cb@256bit.org>
parents: 13105
diff changeset
3946 Xclose
9812a9ca3ab2 patch 8.0.1432: after ":copen" can't get the window-ID of the quickfix window
Christian Brabandt <cb@256bit.org>
parents: 13105
diff changeset
3947
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3948 " Empty quickfix list
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3949 Xexpr ""
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3950 call assert_equal('', g:Xgetlist({'context' : 0}).context)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3951 call assert_notequal(0, g:Xgetlist({'id' : 0}).id)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3952 call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3953 call assert_equal([], g:Xgetlist({'items' : 0}).items)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3954 call assert_notequal(0, g:Xgetlist({'nr' : 0}).nr)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3955 call assert_equal(0, g:Xgetlist({'size' : 0}).size)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3956 call assert_notequal('', g:Xgetlist({'title' : 0}).title)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3957 call assert_equal(0, g:Xgetlist({'winid' : 0}).winid)
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3958 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3959
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3960 let qfid = g:Xgetlist({'id' : 0}).id
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3961 call g:Xsetlist([], 'f')
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3962
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3963 " Non-existing quickfix identifier
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3964 call assert_equal('', g:Xgetlist({'id' : qfid, 'context' : 0}).context)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3965 call assert_equal(0, g:Xgetlist({'id' : qfid}).id)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3966 call assert_equal(0, g:Xgetlist({'id' : qfid, 'idx' : 0}).idx)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3967 call assert_equal([], g:Xgetlist({'id' : qfid, 'items' : 0}).items)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3968 call assert_equal(0, g:Xgetlist({'id' : qfid, 'nr' : 0}).nr)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3969 call assert_equal(0, g:Xgetlist({'id' : qfid, 'size' : 0}).size)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3970 call assert_equal('', g:Xgetlist({'id' : qfid, 'title' : 0}).title)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3971 call assert_equal(0, g:Xgetlist({'id' : qfid, 'winid' : 0}).winid)
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3972 call assert_equal(0, g:Xgetlist({'id' : qfid, 'changedtick' : 0}).changedtick)
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3973 if a:cchar == 'c'
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3974 call assert_equal({'context' : '', 'id' : 0, 'idx' : 0, 'items' : [],
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3975 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 0,
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3976 \ 'qfbufnr' : qfbufnr, 'quickfixtextfunc' : '',
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3977 \ 'changedtick' : 0}, g:Xgetlist({'id' : qfid, 'all' : 0}))
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3978 else
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3979 call assert_equal({'context' : '', 'id' : 0, 'idx' : 0, 'items' : [],
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3980 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 0,
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3981 \ 'changedtick' : 0, 'filewinid' : 0, 'qfbufnr' : 0,
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3982 \ 'quickfixtextfunc' : ''},
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3983 \ g:Xgetlist({'id' : qfid, 'all' : 0}))
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3984 endif
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3985
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3986 " Non-existing quickfix list number
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3987 call assert_equal('', g:Xgetlist({'nr' : 5, 'context' : 0}).context)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3988 call assert_equal(0, g:Xgetlist({'nr' : 5}).nr)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3989 call assert_equal(0, g:Xgetlist({'nr' : 5, 'idx' : 0}).idx)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3990 call assert_equal([], g:Xgetlist({'nr' : 5, 'items' : 0}).items)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3991 call assert_equal(0, g:Xgetlist({'nr' : 5, 'id' : 0}).id)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3992 call assert_equal(0, g:Xgetlist({'nr' : 5, 'size' : 0}).size)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3993 call assert_equal('', g:Xgetlist({'nr' : 5, 'title' : 0}).title)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3994 call assert_equal(0, g:Xgetlist({'nr' : 5, 'winid' : 0}).winid)
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3995 call assert_equal(0, g:Xgetlist({'nr' : 5, 'changedtick' : 0}).changedtick)
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3996 if a:cchar == 'c'
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3997 call assert_equal({'context' : '', 'id' : 0, 'idx' : 0, 'items' : [],
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3998 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 0,
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
3999 \ 'changedtick' : 0, 'qfbufnr' : qfbufnr,
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
4000 \ 'quickfixtextfunc' : ''}, g:Xgetlist({'nr' : 5, 'all' : 0}))
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
4001 else
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
4002 call assert_equal({'context' : '', 'id' : 0, 'idx' : 0, 'items' : [],
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
4003 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 0,
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
4004 \ 'changedtick' : 0, 'filewinid' : 0, 'qfbufnr' : 0,
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
4005 \ 'quickfixtextfunc' : ''}, g:Xgetlist({'nr' : 5, 'all' : 0}))
14664
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
4006 endif
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
4007 endfunc
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
4008
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
4009 func Test_getqflist()
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
4010 call Xgetlist_empty_tests('c')
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
4011 call Xgetlist_empty_tests('l')
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
4012 endfunc
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4013
13066
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4014 func Test_getqflist_invalid_nr()
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4015 " The following commands used to crash Vim
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4016 cexpr ""
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4017 call getqflist({'nr' : $XXX_DOES_NOT_EXIST_XXX})
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4018
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4019 " Cleanup
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4020 call setqflist([], 'r')
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4021 endfunc
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
4022
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4023 " Tests for the quickfix/location list changedtick
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4024 func Xqftick_tests(cchar)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4025 call s:setup_commands(a:cchar)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4026
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4027 call g:Xsetlist([], 'f')
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4028
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4029 Xexpr "F1:10:Line10"
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4030 let qfid = g:Xgetlist({'id' : 0}).id
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4031 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4032 Xaddexpr "F2:20:Line20\nF2:21:Line21"
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4033 call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4034 call g:Xsetlist([], 'a', {'lines' : ["F3:30:Line30", "F3:31:Line31"]})
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4035 call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4036 call g:Xsetlist([], 'r', {'lines' : ["F4:40:Line40"]})
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4037 call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4038 call g:Xsetlist([], 'a', {'title' : 'New Title'})
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4039 call assert_equal(5, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4040
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4041 enew!
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4042 call append(0, ["F5:50:L50", "F6:60:L60"])
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4043 Xaddbuffer
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4044 call assert_equal(6, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4045 enew!
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4046
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4047 call g:Xsetlist([], 'a', {'context' : {'bus' : 'pci'}})
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4048 call assert_equal(7, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4049 call g:Xsetlist([{'filename' : 'F7', 'lnum' : 10, 'text' : 'L7'},
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4050 \ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'a')
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4051 call assert_equal(8, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4052 call g:Xsetlist([{'filename' : 'F7', 'lnum' : 10, 'text' : 'L7'},
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4053 \ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], ' ')
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4054 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4055 call g:Xsetlist([{'filename' : 'F7', 'lnum' : 10, 'text' : 'L7'},
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4056 \ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'r')
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4057 call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4058
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4059 call writefile(["F8:80:L80", "F8:81:L81"], "Xone")
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4060 Xfile Xone
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4061 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4062 Xaddfile Xone
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4063 call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4064
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4065 " Test case for updating a non-current quickfix list
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4066 call g:Xsetlist([], 'f')
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4067 Xexpr "F1:1:L1"
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4068 Xexpr "F2:2:L2"
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4069 call g:Xsetlist([], 'a', {'nr' : 1, "lines" : ["F10:10:L10"]})
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4070 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4071 call assert_equal(2, g:Xgetlist({'nr' : 1, 'changedtick' : 0}).changedtick)
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4072
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4073 call delete("Xone")
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4074 endfunc
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4075
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4076 func Test_qf_tick()
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4077 call Xqftick_tests('c')
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4078 call Xqftick_tests('l')
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
4079 endfunc
13074
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4080
14603
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4081 " Test helpgrep with lang specifier
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4082 func Xtest_helpgrep_with_lang_specifier(cchar)
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4083 call s:setup_commands(a:cchar)
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4084 Xhelpgrep Vim@en
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4085 call assert_equal('help', &filetype)
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4086 call assert_notequal(0, g:Xgetlist({'nr' : '$'}).nr)
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4087 new | only
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4088 endfunc
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4089
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4090 func Test_helpgrep_with_lang_specifier()
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4091 call Xtest_helpgrep_with_lang_specifier('c')
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4092 call Xtest_helpgrep_with_lang_specifier('l')
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4093 endfunc
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
4094
13074
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4095 " The following test used to crash Vim.
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4096 " Open the location list window and close the regular window associated with
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4097 " the location list. When the garbage collection runs now, it incorrectly
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4098 " marks the location list context as not in use and frees the context.
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4099 func Test_ll_window_ctx()
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4100 call setloclist(0, [], 'f')
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4101 call setloclist(0, [], 'a', {'context' : []})
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4102 lopen | only
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4103 call test_garbagecollect_now()
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4104 echo getloclist(0, {'context' : 1}).context
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4105 enew | only
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4106 endfunc
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
4107
13078
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
4108 " The following test used to crash vim
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
4109 func Test_lfile_crash()
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
4110 sp Xtest
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
4111 au QuickFixCmdPre * bw
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
4112 call assert_fails('lfile', 'E40:')
13078
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
4113 au! QuickFixCmdPre
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
4114 endfunc
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4115
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4116 " The following test used to crash vim
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4117 func Test_lbuffer_crash()
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4118 sv Xtest
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4119 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4120 au!
23758
97296182d336 patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents: 23493
diff changeset
4121 au QuickFixCmdPre,QuickFixCmdPost,BufEnter,BufLeave * bw
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4122 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4123 lbuffer
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4124 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4125 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4126 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4127 endfunc
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4128
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4129 " The following test used to crash vim
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4130 func Test_lexpr_crash()
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4131 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4132 au!
23758
97296182d336 patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents: 23493
diff changeset
4133 au QuickFixCmdPre,QuickFixCmdPost,BufEnter,BufLeave * call setloclist(0, [], 'f')
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4134 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4135 lexpr ""
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4136 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4137 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4138 augroup END
14954
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4139
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4140 enew | only
14954
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4141 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4142 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4143 au BufNew * call setloclist(0, [], 'f')
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4144 augroup END
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4145 lexpr 'x:1:x'
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4146 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4147 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4148 augroup END
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4149
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4150 enew | only
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4151 lexpr ''
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4152 lopen
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4153 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4154 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4155 au FileType * call setloclist(0, [], 'f')
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4156 augroup END
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4157 lexpr ''
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4158 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4159 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
4160 augroup END
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4161 endfunc
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4162
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4163 " The following test used to crash Vim
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4164 func Test_lvimgrep_crash()
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4165 sv Xtest
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4166 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4167 au!
23758
97296182d336 patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents: 23493
diff changeset
4168 au QuickFixCmdPre,QuickFixCmdPost,BufEnter,BufLeave * call setloclist(0, [], 'f')
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4169 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4170 lvimgrep quickfix test_quickfix.vim
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4171 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4172 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4173 augroup END
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4174
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4175 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4176 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4177 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4178 au BufEnter * call setloclist(0, [], 'r')
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4179 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4180 call assert_fails('lvimgrep Test_lvimgrep_crash *', 'E926:')
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4181 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4182 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4183 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4184
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4185 enew | only
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
4186 endfunc
13105
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4187
19649
d4baa35fea5d patch 8.2.0381: using freed memory with :lvimgrep and autocommand
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
4188 func Test_lvimgrep_crash2()
d4baa35fea5d patch 8.2.0381: using freed memory with :lvimgrep and autocommand
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
4189 au BufNewFile x sfind
21265
6a4806e326dd patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents: 21100
diff changeset
4190 call assert_fails('lvimgrep x x', 'E471:')
6a4806e326dd patch 8.2.1183: assert_fails() checks the last error message
Bram Moolenaar <Bram@vim.org>
parents: 21100
diff changeset
4191 call assert_fails('lvimgrep x x x', 'E471:')
19649
d4baa35fea5d patch 8.2.0381: using freed memory with :lvimgrep and autocommand
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
4192
d4baa35fea5d patch 8.2.0381: using freed memory with :lvimgrep and autocommand
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
4193 au! BufNewFile
d4baa35fea5d patch 8.2.0381: using freed memory with :lvimgrep and autocommand
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
4194 endfunc
d4baa35fea5d patch 8.2.0381: using freed memory with :lvimgrep and autocommand
Bram Moolenaar <Bram@vim.org>
parents: 19471
diff changeset
4195
13105
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4196 " Test for the position of the quickfix and location list window
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4197 func Test_qfwin_pos()
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4198 " Open two windows
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4199 new | only
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4200 new
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4201 cexpr ['F1:10:L10']
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4202 copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4203 " Quickfix window should be the bottom most window
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4204 call assert_equal(3, winnr())
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4205 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4206 " Open at the very top
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4207 wincmd t
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4208 topleft copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4209 call assert_equal(1, winnr())
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4210 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4211 " open left of the current window
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4212 wincmd t
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4213 below new
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4214 leftabove copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4215 call assert_equal(2, winnr())
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4216 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4217 " open right of the current window
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4218 rightbelow copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4219 call assert_equal(3, winnr())
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4220 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
4221 endfunc
13594
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4222
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4223 " Tests for quickfix/location lists changed by autocommands when
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4224 " :vimgrep/:lvimgrep commands are running.
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4225 func Test_vimgrep_autocmd()
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4226 call setqflist([], 'f')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4227 call writefile(['stars'], 'Xtest1.txt')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4228 call writefile(['stars'], 'Xtest2.txt')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4229
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4230 " Test 1:
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4231 " When searching for a pattern using :vimgrep, if the quickfix list is
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4232 " changed by an autocmd, the results should be added to the correct quickfix
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4233 " list.
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4234 autocmd BufRead Xtest2.txt cexpr '' | cexpr ''
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4235 silent vimgrep stars Xtest*.txt
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4236 call assert_equal(1, getqflist({'nr' : 0}).nr)
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4237 call assert_equal(3, getqflist({'nr' : '$'}).nr)
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4238 call assert_equal('Xtest2.txt', bufname(getqflist()[1].bufnr))
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4239 au! BufRead Xtest2.txt
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4240
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4241 " Test 2:
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4242 " When searching for a pattern using :vimgrep, if the quickfix list is
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4243 " freed, then a error should be given.
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4244 silent! %bwipe!
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4245 call setqflist([], 'f')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4246 autocmd BufRead Xtest2.txt for i in range(10) | cexpr '' | endfor
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4247 call assert_fails('vimgrep stars Xtest*.txt', 'E925:')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4248 au! BufRead Xtest2.txt
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4249
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4250 " Test 3:
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4251 " When searching for a pattern using :lvimgrep, if the location list is
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4252 " freed, then the command should error out.
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4253 silent! %bwipe!
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4254 let g:save_winid = win_getid()
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4255 autocmd BufRead Xtest2.txt call setloclist(g:save_winid, [], 'f')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4256 call assert_fails('lvimgrep stars Xtest*.txt', 'E926:')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4257 au! BufRead Xtest2.txt
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4258
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4259 call delete('Xtest1.txt')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4260 call delete('Xtest2.txt')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4261 call setqflist([], 'f')
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
4262 endfunc
13756
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4263
18656
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4264 " Test for an autocmd changing the current directory when running vimgrep
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4265 func Xvimgrep_autocmd_cd(cchar)
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4266 call s:setup_commands(a:cchar)
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4267
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4268 %bwipe
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4269 let save_cwd = getcwd()
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4270
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4271 augroup QF_Test
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4272 au!
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4273 autocmd BufRead * silent cd %:p:h
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4274 augroup END
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4275
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4276 10Xvimgrep /vim/ Xdir/**
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4277 let l = g:Xgetlist()
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4278 call assert_equal('f1.txt', bufname(l[0].bufnr))
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4279 call assert_equal('f2.txt', fnamemodify(bufname(l[2].bufnr), ':t'))
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4280
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4281 augroup QF_Test
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4282 au!
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4283 augroup END
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4284
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4285 exe 'cd ' . save_cwd
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4286 endfunc
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4287
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4288 func Test_vimgrep_autocmd_cd()
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4289 call mkdir('Xdir/a', 'p')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4290 call mkdir('Xdir/b', 'p')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4291 call writefile(['a_L1_vim', 'a_L2_vim'], 'Xdir/a/f1.txt')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4292 call writefile(['b_L1_vim', 'b_L2_vim'], 'Xdir/b/f2.txt')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4293 call Xvimgrep_autocmd_cd('c')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4294 call Xvimgrep_autocmd_cd('l')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4295 %bwipe
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4296 call delete('Xdir', 'rf')
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4297 endfunc
022deb0adec9 patch 8.1.2320: insufficient test coverage for quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18646
diff changeset
4298
13756
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4299 " The following test used to crash Vim
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4300 func Test_lhelpgrep_autocmd()
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4301 lhelpgrep quickfix
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4302 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4303 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4304 autocmd QuickFixCmdPost * call setloclist(0, [], 'f')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4305 augroup END
13756
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4306 lhelpgrep buffer
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4307 call assert_equal('help', &filetype)
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4308 call assert_equal(0, getloclist(0, {'nr' : '$'}).nr)
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4309 lhelpgrep tabpage
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4310 call assert_equal('help', &filetype)
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4311 call assert_equal(1, getloclist(0, {'nr' : '$'}).nr)
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4312 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4313 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4314 augroup END
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4315
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4316 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4317 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4318 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4319 au BufEnter * call setqflist([], 'f')
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4320 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4321 call assert_fails('helpgrep quickfix', 'E925:')
22788
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 22645
diff changeset
4322 " run the test with a help window already open
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 22645
diff changeset
4323 help
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 22645
diff changeset
4324 wincmd w
c8a4ad051d23 patch 8.2.1942: insufficient test coverage for the Netbeans interface
Bram Moolenaar <Bram@vim.org>
parents: 22645
diff changeset
4325 call assert_fails('helpgrep quickfix', 'E925:')
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4326 augroup QF_Test
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4327 au!
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4328 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4329
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4330 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4331 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4332 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4333 au BufEnter * call setqflist([], 'r')
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4334 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4335 call assert_fails('helpgrep quickfix', 'E925:')
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4336 augroup QF_Test
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4337 au!
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4338 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4339
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4340 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4341 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4342 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4343 au BufEnter * call setloclist(0, [], 'r')
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4344 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4345 call assert_fails('lhelpgrep quickfix', 'E926:')
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4346 augroup QF_Test
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4347 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4348 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4349
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4350 " Replace the contents of a help window location list when it is still in
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4351 " use.
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4352 new | only
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4353 lhelpgrep quickfix
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4354 wincmd w
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4355 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4356 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4357 autocmd WinEnter * call setloclist(0, [], 'r')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4358 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4359 call assert_fails('lhelpgrep win_getid', 'E926:')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4360 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4361 au!
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4362 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
4363
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4364 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4365 endfunc
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4366
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4367 " The following test used to crash Vim
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4368 func Test_lhelpgrep_autocmd_free_loclist()
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4369 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4370 lhelpgrep quickfix
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4371 wincmd w
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4372 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4373 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4374 autocmd WinEnter * call setloclist(0, [], 'f')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4375 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4376 lhelpgrep win_getid
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4377 wincmd w
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4378 wincmd w
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4379 wincmd w
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4380 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4381 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4382 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
4383 %bw!
13756
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
4384 endfunc
13819
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4385
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4386 " Test for shortening/simplifying the file name when opening the
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4387 " quickfix window or when displaying the quickfix list
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4388 func Test_shorten_fname()
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21741
diff changeset
4389 CheckUnix
13819
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4390 %bwipe
26211
485c7c4afeb7 patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents: 26026
diff changeset
4391 " Create a quickfix list with an absolute path filename
13819
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4392 let fname = getcwd() . '/test_quickfix.vim'
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4393 call setqflist([], ' ', {'lines':[fname . ":20:Line20"], 'efm':'%f:%l:%m'})
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4394 call assert_equal(fname, bufname('test_quickfix.vim'))
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4395 " Opening the quickfix window should simplify the file path
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4396 cwindow
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4397 call assert_equal('test_quickfix.vim', bufname('test_quickfix.vim'))
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4398 cclose
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4399 %bwipe
26211
485c7c4afeb7 patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents: 26026
diff changeset
4400 " Create a quickfix list with an absolute path filename
13819
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4401 call setqflist([], ' ', {'lines':[fname . ":20:Line20"], 'efm':'%f:%l:%m'})
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4402 call assert_equal(fname, bufname('test_quickfix.vim'))
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4403 " Displaying the quickfix list should simplify the file path
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4404 silent! clist
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4405 call assert_equal('test_quickfix.vim', bufname('test_quickfix.vim'))
22454
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4406 " Add a few entries for the same file with different paths and check whether
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4407 " the buffer name is shortened
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4408 %bwipe
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4409 call setqflist([], 'f')
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4410 call setqflist([{'filename' : 'test_quickfix.vim', 'lnum' : 10},
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4411 \ {'filename' : '../testdir/test_quickfix.vim', 'lnum' : 20},
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4412 \ {'filename' : fname, 'lnum' : 30}], ' ')
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4413 copen
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4414 call assert_equal(['test_quickfix.vim|10| ',
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4415 \ 'test_quickfix.vim|20| ',
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4416 \ 'test_quickfix.vim|30| '], getline(1, '$'))
849c6f766b19 patch 8.2.1775: MS-Windows: adding a long quickfix list is slow
Bram Moolenaar <Bram@vim.org>
parents: 22256
diff changeset
4417 cclose
13819
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
4418 endfunc
13921
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4419
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4420 " Quickfix title tests
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4421 " In the below tests, 'exe "cmd"' is used to invoke the quickfix commands.
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4422 " Otherwise due to indentation, the title is set with spaces at the beginning
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4423 " of the command.
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4424 func Test_qftitle()
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4425 call writefile(["F1:1:Line1"], 'Xerr')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4426
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4427 " :cexpr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4428 exe "cexpr readfile('Xerr')"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4429 call assert_equal(":cexpr readfile('Xerr')", getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4430
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4431 " :cgetexpr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4432 exe "cgetexpr readfile('Xerr')"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4433 call assert_equal(":cgetexpr readfile('Xerr')",
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4434 \ getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4435
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4436 " :caddexpr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4437 call setqflist([], 'f')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4438 exe "caddexpr readfile('Xerr')"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4439 call assert_equal(":caddexpr readfile('Xerr')",
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4440 \ getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4441
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4442 " :cbuffer
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4443 new Xerr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4444 exe "cbuffer"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4445 call assert_equal(':cbuffer (Xerr)', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4446
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4447 " :cgetbuffer
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4448 edit Xerr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4449 exe "cgetbuffer"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4450 call assert_equal(':cgetbuffer (Xerr)', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4451
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4452 " :caddbuffer
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4453 call setqflist([], 'f')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4454 edit Xerr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4455 exe "caddbuffer"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4456 call assert_equal(':caddbuffer (Xerr)', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4457
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4458 " :cfile
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4459 exe "cfile Xerr"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4460 call assert_equal(':cfile Xerr', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4461
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4462 " :cgetfile
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4463 exe "cgetfile Xerr"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4464 call assert_equal(':cgetfile Xerr', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4465
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4466 " :caddfile
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4467 call setqflist([], 'f')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4468 exe "caddfile Xerr"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4469 call assert_equal(':caddfile Xerr', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4470
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4471 " :grep
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4472 set grepprg=internal
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4473 exe "grep F1 Xerr"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4474 call assert_equal(':grep F1 Xerr', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4475
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4476 " :grepadd
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4477 call setqflist([], 'f')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4478 exe "grepadd F1 Xerr"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4479 call assert_equal(':grepadd F1 Xerr', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4480 set grepprg&vim
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4481
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4482 " :vimgrep
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4483 exe "vimgrep F1 Xerr"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4484 call assert_equal(':vimgrep F1 Xerr', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4485
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4486 " :vimgrepadd
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4487 call setqflist([], 'f')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4488 exe "vimgrepadd F1 Xerr"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4489 call assert_equal(':vimgrepadd F1 Xerr', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4490
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4491 call setqflist(['F1:10:L10'], ' ')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4492 call assert_equal(':setqflist()', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4493
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4494 call setqflist([], 'f')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4495 call setqflist(['F1:10:L10'], 'a')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4496 call assert_equal(':setqflist()', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4497
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4498 call setqflist([], 'f')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4499 call setqflist(['F1:10:L10'], 'r')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4500 call assert_equal(':setqflist()', getqflist({'title' : 1}).title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4501
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4502 close
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4503 call delete('Xerr')
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4504
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4505 call setqflist([], ' ', {'title' : 'Errors'})
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4506 copen
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4507 call assert_equal('Errors', w:quickfix_title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4508 call setqflist([], 'r', {'items' : [{'filename' : 'a.c', 'lnum' : 10}]})
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4509 call assert_equal('Errors', w:quickfix_title)
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4510 cclose
23203
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4511
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4512 " Switching to another quickfix list in one tab page should update the
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4513 " quickfix window title and statusline in all the other tab pages also
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4514 call setqflist([], 'f')
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4515 %bw!
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4516 cgetexpr ['file_one:1:1: error in the first quickfix list']
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4517 call setqflist([], 'a', {'title': 'first quickfix list'})
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4518 cgetexpr ['file_two:2:1: error in the second quickfix list']
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4519 call setqflist([], 'a', {'title': 'second quickfix list'})
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4520 copen
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4521 wincmd t
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4522 tabnew two
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4523 copen
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4524 wincmd t
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4525 colder
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4526 call assert_equal('first quickfix list', gettabwinvar(1, 2, 'quickfix_title'))
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4527 call assert_equal('first quickfix list', gettabwinvar(2, 2, 'quickfix_title'))
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4528 call assert_equal(1, tabpagewinnr(1))
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4529 call assert_equal(1, tabpagewinnr(2))
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4530 tabnew
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4531 call setqflist([], 'a', {'title': 'new quickfix title'})
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4532 call assert_equal('new quickfix title', gettabwinvar(1, 2, 'quickfix_title'))
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4533 call assert_equal('new quickfix title', gettabwinvar(2, 2, 'quickfix_title'))
db97415750ce patch 8.2.2147: quickfix window title not updated in all tab pages
Bram Moolenaar <Bram@vim.org>
parents: 23092
diff changeset
4534 %bw!
13921
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
4535 endfunc
14085
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4536
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4537 func Test_lbuffer_with_bwipe()
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4538 new
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4539 new
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4540 augroup nasty
23758
97296182d336 patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents: 23493
diff changeset
4541 au QuickFixCmdPre,QuickFixCmdPost,BufEnter,BufLeave * bwipe
14085
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4542 augroup END
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4543 lbuffer
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4544 augroup nasty
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4545 au!
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4546 augroup END
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
4547 endfunc
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
4548
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4549 " Test for an autocmd freeing the quickfix/location list when cexpr/lexpr is
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4550 " running
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4551 func Xexpr_acmd_freelist(cchar)
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4552 call s:setup_commands(a:cchar)
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4553
23758
97296182d336 patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents: 23493
diff changeset
4554 " This was using freed memory (but with what events?)
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
4555 augroup nasty
23758
97296182d336 patch 8.2.2420: too many problems with using all autocommand events
Bram Moolenaar <Bram@vim.org>
parents: 23493
diff changeset
4556 au QuickFixCmdPre,QuickFixCmdPost,BufEnter,BufLeave * call g:Xsetlist([], 'f')
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
4557 augroup END
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4558 Xexpr "x"
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
4559 augroup nasty
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
4560 au!
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
4561 augroup END
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
4562 endfunc
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4563
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4564 func Test_cexpr_acmd_freelist()
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4565 call Xexpr_acmd_freelist('c')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4566 call Xexpr_acmd_freelist('l')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4567 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4568
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4569 " Test for commands that create a new quickfix/location list and jump to the
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4570 " first error automatically.
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4571 func Xjumpto_first_error_test(cchar)
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4572 call s:setup_commands(a:cchar)
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4573
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4574 call s:create_test_file('Xtestfile1')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4575 call s:create_test_file('Xtestfile2')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4576 let l = ['Xtestfile1:2:Line2', 'Xtestfile2:4:Line4']
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4577
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4578 " Test for cexpr/lexpr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4579 enew
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4580 Xexpr l
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4581 call assert_equal('Xtestfile1', @%)
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4582 call assert_equal(2, line('.'))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4583
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4584 " Test for cfile/lfile
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4585 enew
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4586 call writefile(l, 'Xerr')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4587 Xfile Xerr
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4588 call assert_equal('Xtestfile1', @%)
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4589 call assert_equal(2, line('.'))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4590
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4591 " Test for cbuffer/lbuffer
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4592 edit Xerr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4593 Xbuffer
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4594 call assert_equal('Xtestfile1', @%)
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4595 call assert_equal(2, line('.'))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4596
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4597 call delete('Xerr')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4598 call delete('Xtestfile1')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4599 call delete('Xtestfile2')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4600 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4601
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4602 func Test_jumpto_first_error()
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4603 call Xjumpto_first_error_test('c')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4604 call Xjumpto_first_error_test('l')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4605 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4606
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4607 " Test for a quickfix autocmd changing the quickfix/location list before
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4608 " jumping to the first error in the new list.
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4609 func Xautocmd_changelist(cchar)
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4610 call s:setup_commands(a:cchar)
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4611
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4612 " Test for cfile/lfile
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4613 call s:create_test_file('Xtestfile1')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4614 call s:create_test_file('Xtestfile2')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4615 Xexpr 'Xtestfile1:2:Line2'
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4616 autocmd QuickFixCmdPost * Xolder
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4617 call writefile(['Xtestfile2:4:Line4'], 'Xerr')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4618 Xfile Xerr
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4619 call assert_equal('Xtestfile2', @%)
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4620 call assert_equal(4, line('.'))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4621 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4622
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4623 " Test for cbuffer/lbuffer
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4624 call g:Xsetlist([], 'f')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4625 Xexpr 'Xtestfile1:2:Line2'
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4626 autocmd QuickFixCmdPost * Xolder
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4627 call writefile(['Xtestfile2:4:Line4'], 'Xerr')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4628 edit Xerr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4629 Xbuffer
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4630 call assert_equal('Xtestfile2', @%)
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4631 call assert_equal(4, line('.'))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4632 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4633
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4634 " Test for cexpr/lexpr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4635 call g:Xsetlist([], 'f')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4636 Xexpr 'Xtestfile1:2:Line2'
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4637 autocmd QuickFixCmdPost * Xolder
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4638 Xexpr 'Xtestfile2:4:Line4'
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4639 call assert_equal('Xtestfile2', @%)
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4640 call assert_equal(4, line('.'))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4641 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4642
14258
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4643 " The grepprg may not be set on non-Unix systems
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4644 if has('unix')
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4645 " Test for grep/lgrep
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4646 call g:Xsetlist([], 'f')
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4647 Xexpr 'Xtestfile1:2:Line2'
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4648 autocmd QuickFixCmdPost * Xolder
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4649 silent Xgrep Line5 Xtestfile2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4650 call assert_equal('Xtestfile2', @%)
14258
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4651 call assert_equal(5, line('.'))
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4652 autocmd! QuickFixCmdPost
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
4653 endif
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4654
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4655 " Test for vimgrep/lvimgrep
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4656 call g:Xsetlist([], 'f')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4657 Xexpr 'Xtestfile1:2:Line2'
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4658 autocmd QuickFixCmdPost * Xolder
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4659 silent Xvimgrep Line5 Xtestfile2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4660 call assert_equal('Xtestfile2', @%)
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4661 call assert_equal(5, line('.'))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4662 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4663
14491
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4664 " Test for autocommands clearing the quickfix list before jumping to the
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4665 " first error. This should not result in an error
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4666 autocmd QuickFixCmdPost * call g:Xsetlist([], 'r')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4667 let v:errmsg = ''
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4668 " Test for cfile/lfile
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4669 Xfile Xerr
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4670 call assert_true(v:errmsg !~# 'E42:')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4671 " Test for cbuffer/lbuffer
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4672 edit Xerr
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4673 Xbuffer
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4674 call assert_true(v:errmsg !~# 'E42:')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4675 " Test for cexpr/lexpr
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4676 Xexpr 'Xtestfile2:4:Line4'
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4677 call assert_true(v:errmsg !~# 'E42:')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4678 " Test for grep/lgrep
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4679 " The grepprg may not be set on non-Unix systems
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4680 if has('unix')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4681 silent Xgrep Line5 Xtestfile2
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4682 call assert_true(v:errmsg !~# 'E42:')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4683 endif
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4684 " Test for vimgrep/lvimgrep
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4685 call assert_fails('silent Xvimgrep Line5 Xtestfile2', 'E480:')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4686 autocmd! QuickFixCmdPost
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
4687
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4688 call delete('Xerr')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4689 call delete('Xtestfile1')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4690 call delete('Xtestfile2')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4691 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4692
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4693 func Test_autocmd_changelist()
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4694 call Xautocmd_changelist('c')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4695 call Xautocmd_changelist('l')
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
4696 endfunc
14299
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4697
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4698 " Tests for the ':filter /pat/ clist' command
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4699 func Test_filter_clist()
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4700 cexpr ['Xfile1:10:10:Line 10', 'Xfile2:15:15:Line 15']
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4701 call assert_equal([' 2 Xfile2:15 col 15: Line 15'],
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4702 \ split(execute('filter /Line 15/ clist'), "\n"))
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4703 call assert_equal([' 1 Xfile1:10 col 10: Line 10'],
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4704 \ split(execute('filter /Xfile1/ clist'), "\n"))
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4705 call assert_equal([], split(execute('filter /abc/ clist'), "\n"))
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4706
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4707 call setqflist([{'module' : 'abc', 'pattern' : 'pat1'},
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4708 \ {'module' : 'pqr', 'pattern' : 'pat2'}], ' ')
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4709 call assert_equal([' 2 pqr:pat2: '],
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4710 \ split(execute('filter /pqr/ clist'), "\n"))
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4711 call assert_equal([' 1 abc:pat1: '],
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4712 \ split(execute('filter /pat1/ clist'), "\n"))
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
4713 endfunc
14397
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4714
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4715 " Tests for the "CTRL-W <CR>" command.
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4716 func Xview_result_split_tests(cchar)
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4717 call s:setup_commands(a:cchar)
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4718
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4719 " Test that "CTRL-W <CR>" in a qf/ll window fails with empty list.
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4720 call g:Xsetlist([])
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4721 Xopen
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4722 let l:win_count = winnr('$')
22087
ff21e2962490 patch 8.2.1593: tests do not check the error number properly
Bram Moolenaar <Bram@vim.org>
parents: 22083
diff changeset
4723 call assert_fails('execute "normal! \<C-W>\<CR>"', 'E42:')
14397
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4724 call assert_equal(l:win_count, winnr('$'))
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4725 Xclose
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4726 endfunc
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4727
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4728 func Test_view_result_split()
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4729 call Xview_result_split_tests('c')
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4730 call Xview_result_split_tests('l')
19d99d9e670c patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window
Christian Brabandt <cb@256bit.org>
parents: 14299
diff changeset
4731 endfunc
14552
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4732
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4733 " Test that :cc sets curswant
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4734 func Test_curswant()
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4735 helpgrep quickfix
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4736 normal! llll
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4737 1cc
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4738 call assert_equal(getcurpos()[4], virtcol('.'))
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4739 cclose | helpclose
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
4740 endfunc
15024
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4741
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4742 " Test for opening a file from the quickfix window using CTRL-W <Enter>
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4743 " doesn't leave an empty buffer around.
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4744 func Test_splitview()
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4745 call s:create_test_file('Xtestfile1')
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4746 call s:create_test_file('Xtestfile2')
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4747 new | only
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4748 let last_bufnr = bufnr('Test_sv_1', 1)
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4749 let l = ['Xtestfile1:2:Line2', 'Xtestfile2:4:Line4']
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4750 cgetexpr l
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4751 copen
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4752 let numbufs = len(getbufinfo())
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4753 exe "normal \<C-W>\<CR>"
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4754 copen
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4755 exe "normal j\<C-W>\<CR>"
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4756 " Make sure new empty buffers are not created
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4757 call assert_equal(numbufs, len(getbufinfo()))
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4758 " Creating a new buffer should use the next available buffer number
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4759 call assert_equal(last_bufnr + 4, bufnr("Test_sv_2", 1))
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4760 bwipe Test_sv_1
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4761 bwipe Test_sv_2
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4762 new | only
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4763
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4764 " When split opening files from location list window, make sure that two
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4765 " windows doesn't refer to the same location list
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4766 lgetexpr l
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4767 let locid = getloclist(0, {'id' : 0}).id
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4768 lopen
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4769 exe "normal \<C-W>\<CR>"
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4770 call assert_notequal(locid, getloclist(0, {'id' : 0}).id)
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4771 call assert_equal(0, getloclist(0, {'winid' : 0}).winid)
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4772 new | only
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4773
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4774 " When split opening files from a helpgrep location list window, a new help
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4775 " window should be opened with a copy of the location list.
15024
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4776 lhelpgrep window
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4777 let locid = getloclist(0, {'id' : 0}).id
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4778 lwindow
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4779 exe "normal j\<C-W>\<CR>"
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4780 call assert_notequal(locid, getloclist(0, {'id' : 0}).id)
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4781 call assert_equal(0, getloclist(0, {'winid' : 0}).winid)
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4782 new | only
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4783
19435
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4784 " Using :split or :vsplit from a quickfix window should behave like a :new
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4785 " or a :vnew command
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4786 copen
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4787 split
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4788 call assert_equal(3, winnr('$'))
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4789 let l = getwininfo()
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4790 call assert_equal([0, 0, 1], [l[0].quickfix, l[1].quickfix, l[2].quickfix])
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4791 close
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4792 copen
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4793 vsplit
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4794 let l = getwininfo()
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4795 call assert_equal([0, 0, 1], [l[0].quickfix, l[1].quickfix, l[2].quickfix])
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4796 new | only
8f8a5a15d00a patch 8.2.0275: some Ex code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents: 19407
diff changeset
4797
15024
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4798 call delete('Xtestfile1')
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4799 call delete('Xtestfile2')
3a3c9b638187 patch 8.1.0523: opening window from quickfix leaves empty buffer behind
Bram Moolenaar <Bram@vim.org>
parents: 14976
diff changeset
4800 endfunc
15703
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4801
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4802 " Test for parsing entries using visual screen column
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4803 func Test_viscol()
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4804 enew
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4805 call writefile(["Col1\tCol2\tCol3"], 'Xfile1')
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4806 edit Xfile1
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4807
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4808 " Use byte offset for column number
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4809 set efm&
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4810 cexpr "Xfile1:1:5:XX\nXfile1:1:9:YY\nXfile1:1:20:ZZ"
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4811 call assert_equal([5, 8], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4812 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4813 call assert_equal([9, 12], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4814 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4815 call assert_equal([14, 20], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4816
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4817 " Use screen column offset for column number
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4818 set efm=%f:%l:%v:%m
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4819 cexpr "Xfile1:1:8:XX\nXfile1:1:12:YY\nXfile1:1:20:ZZ"
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4820 call assert_equal([5, 8], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4821 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4822 call assert_equal([9, 12], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4823 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4824 call assert_equal([14, 20], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4825 cexpr "Xfile1:1:6:XX\nXfile1:1:15:YY\nXfile1:1:24:ZZ"
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4826 call assert_equal([5, 8], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4827 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4828 call assert_equal([10, 16], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4829 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4830 call assert_equal([14, 20], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4831
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4832 enew
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4833 call writefile(["Col1\täü\töß\tCol4"], 'Xfile1')
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4834
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4835 " Use byte offset for column number
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4836 set efm&
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4837 cexpr "Xfile1:1:8:XX\nXfile1:1:11:YY\nXfile1:1:16:ZZ"
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4838 call assert_equal([8, 10], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4839 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4840 call assert_equal([11, 17], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4841 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4842 call assert_equal([16, 25], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4843
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4844 " Use screen column offset for column number
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4845 set efm=%f:%l:%v:%m
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4846 cexpr "Xfile1:1:10:XX\nXfile1:1:17:YY\nXfile1:1:25:ZZ"
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4847 call assert_equal([8, 10], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4848 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4849 call assert_equal([11, 17], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4850 cnext
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4851 call assert_equal([16, 25], [col('.'), virtcol('.')])
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4852
22645
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4853 " Use screen column number with a multi-line error message
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4854 enew
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4855 call writefile(["à test"], 'Xfile1')
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4856 set efm=%E===\ %f\ ===,%C%l:%v,%Z%m
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4857 cexpr ["=== Xfile1 ===", "1:3", "errormsg"]
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4858 call assert_equal('Xfile1', @%)
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4859 call assert_equal([0, 1, 4, 0], getpos('.'))
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4860
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4861 " Repeat previous test with byte offset %c: ensure that fix to issue #7145
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4862 " does not break this
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4863 set efm=%E===\ %f\ ===,%C%l:%c,%Z%m
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4864 cexpr ["=== Xfile1 ===", "1:3", "errormsg"]
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4865 call assert_equal('Xfile1', @%)
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4866 call assert_equal([0, 1, 3, 0], getpos('.'))
13904ca59f96 patch 8.2.1871: using %v in 'errorformat' may fail before %Z
Bram Moolenaar <Bram@vim.org>
parents: 22454
diff changeset
4867
15703
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4868 enew | only
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4869 set efm&
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4870 call delete('Xfile1')
b8a2362073bb patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters
Bram Moolenaar <Bram@vim.org>
parents: 15424
diff changeset
4871 endfunc
15740
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4872
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4873 " Test for the quickfix window buffer
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4874 func Xqfbuf_test(cchar)
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4875 call s:setup_commands(a:cchar)
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4876
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4877 " Quickfix buffer should be reused across closing and opening a quickfix
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4878 " window
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4879 Xexpr "F1:10:Line10"
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4880 Xopen
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4881 let qfbnum = bufnr('')
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4882 Xclose
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4883 " Even after the quickfix window is closed, the buffer should be loaded
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4884 call assert_true(bufloaded(qfbnum))
16019
096b8ccd855e patch 8.1.1015: quickfix buffer shows up in list, can't get buffer number
Bram Moolenaar <Bram@vim.org>
parents: 15965
diff changeset
4885 call assert_true(qfbnum, g:Xgetlist({'qfbufnr' : 0}).qfbufnr)
15740
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4886 Xopen
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4887 " Buffer should be reused when opening the window again
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4888 call assert_equal(qfbnum, bufnr(''))
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4889 Xclose
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4890
26464
c0cb28384dc2 patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Bram Moolenaar <Bram@vim.org>
parents: 26458
diff changeset
4891 " When quickfix buffer is wiped out, getqflist() should return 0
c0cb28384dc2 patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Bram Moolenaar <Bram@vim.org>
parents: 26458
diff changeset
4892 %bw!
c0cb28384dc2 patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Bram Moolenaar <Bram@vim.org>
parents: 26458
diff changeset
4893 Xexpr ""
c0cb28384dc2 patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Bram Moolenaar <Bram@vim.org>
parents: 26458
diff changeset
4894 Xopen
c0cb28384dc2 patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Bram Moolenaar <Bram@vim.org>
parents: 26458
diff changeset
4895 bw!
c0cb28384dc2 patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Bram Moolenaar <Bram@vim.org>
parents: 26458
diff changeset
4896 call assert_equal(0, g:Xgetlist({'qfbufnr': 0}).qfbufnr)
c0cb28384dc2 patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it
Bram Moolenaar <Bram@vim.org>
parents: 26458
diff changeset
4897
15740
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4898 if a:cchar == 'l'
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4899 %bwipe
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4900 " For a location list, when both the file window and the location list
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4901 " window for the list are closed, then the buffer should be freed.
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4902 new | only
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4903 lexpr "F1:10:Line10"
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4904 let wid = win_getid()
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4905 lopen
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4906 let qfbnum = bufnr('')
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4907 call assert_match(qfbnum . ' %a- "\[Location List]"', execute('ls'))
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4908 close
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4909 " When the location list window is closed, the buffer name should not
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4910 " change to 'Quickfix List'
16019
096b8ccd855e patch 8.1.1015: quickfix buffer shows up in list, can't get buffer number
Bram Moolenaar <Bram@vim.org>
parents: 15965
diff changeset
4911 call assert_match(qfbnum . 'u h- "\[Location List]"', execute('ls!'))
15740
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4912 call assert_true(bufloaded(qfbnum))
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4913
15965
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4914 " After deleting a location list buffer using ":bdelete", opening the
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4915 " location list window should mark the buffer as a location list buffer.
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4916 exe "bdelete " . qfbnum
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4917 lopen
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4918 call assert_equal("quickfix", &buftype)
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4919 call assert_equal(1, getwininfo(win_getid(winnr()))[0].loclist)
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4920 call assert_equal(wid, getloclist(0, {'filewinid' : 0}).filewinid)
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4921 call assert_false(&swapfile)
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4922 lclose
f376cd250b07 patch 8.1.0988: deleting location list buffer breaks location list window
Bram Moolenaar <Bram@vim.org>
parents: 15770
diff changeset
4923
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4924 " When the location list is cleared for the window, the buffer should be
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4925 " removed
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4926 call setloclist(0, [], 'f')
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4927 call assert_false(bufexists(qfbnum))
16019
096b8ccd855e patch 8.1.1015: quickfix buffer shows up in list, can't get buffer number
Bram Moolenaar <Bram@vim.org>
parents: 15965
diff changeset
4928 call assert_equal(0, getloclist(0, {'qfbufnr' : 0}).qfbufnr)
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4929
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4930 " When the location list is freed with the location list window open, the
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4931 " location list buffer should not be lost. It should be reused when the
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4932 " location list is again populated.
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4933 lexpr "F1:10:Line10"
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4934 lopen
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4935 let wid = win_getid()
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4936 let qfbnum = bufnr('')
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4937 wincmd p
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4938 call setloclist(0, [], 'f')
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4939 lexpr "F1:10:Line10"
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4940 lopen
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4941 call assert_equal(wid, win_getid())
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4942 call assert_equal(qfbnum, bufnr(''))
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4943 lclose
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4944
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4945 " When the window with the location list is closed, the buffer should be
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4946 " removed
15740
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4947 new | only
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4948 call assert_false(bufexists(qfbnum))
15740
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4949 endif
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4950 endfunc
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4951
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4952 func Test_qfbuf()
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4953 call Xqfbuf_test('c')
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4954 call Xqfbuf_test('l')
2fe4a503c5ad patch 8.1.0877: new buffer used every time the quickfix window is opened
Bram Moolenaar <Bram@vim.org>
parents: 15703
diff changeset
4955 endfunc
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4956
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4957 " If there is an autocmd to use only one window, then opening the location
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4958 " list window used to crash Vim.
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4959 func Test_winonly_autocmd()
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4960 call s:create_test_file('Xtest1')
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4961 " Autocmd to show only one Vim window at a time
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4962 autocmd WinEnter * only
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4963 new
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4964 " Load the location list
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4965 lexpr "Xtest1:5:Line5\nXtest1:10:Line10\nXtest1:15:Line15"
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4966 let loclistid = getloclist(0, {'id' : 0}).id
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4967 " Open the location list window. Only this window will be shown and the file
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4968 " window is closed.
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4969 lopen
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4970 call assert_equal(loclistid, getloclist(0, {'id' : 0}).id)
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4971 " Jump to an entry in the location list and make sure that the cursor is
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4972 " positioned correctly.
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4973 ll 3
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4974 call assert_equal(loclistid, getloclist(0, {'id' : 0}).id)
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
4975 call assert_equal('Xtest1', @%)
15770
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4976 call assert_equal(15, line('.'))
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4977 " Cleanup
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4978 autocmd! WinEnter
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4979 new | only
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4980 call delete('Xtest1')
77e97f159554 patch 8.1.0892: failure when closing a window when location list is in use
Bram Moolenaar <Bram@vim.org>
parents: 15740
diff changeset
4981 endfunc
16259
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4982
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4983 " Test to make sure that an empty quickfix buffer is not reused for loading
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4984 " a normal buffer.
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4985 func Test_empty_qfbuf()
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4986 enew | only
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4987 call writefile(["Test"], 'Xfile1')
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4988 call setqflist([], 'f')
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4989 copen | only
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4990 let qfbuf = bufnr('')
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4991 edit Xfile1
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4992 call assert_notequal(qfbuf, bufnr(''))
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4993 enew
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4994 call delete('Xfile1')
1f18984498e1 patch 8.1.1134: buffer for quickfix window is reused for another file
Bram Moolenaar <Bram@vim.org>
parents: 16215
diff changeset
4995 endfunc
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
4996
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
4997 " Test for the :cbelow, :cabove, :lbelow and :labove commands.
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
4998 " And for the :cafter, :cbefore, :lafter and :lbefore commands.
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
4999 func Xtest_below(cchar)
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5000 call s:setup_commands(a:cchar)
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5001
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5002 " No quickfix/location list
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5003 call assert_fails('Xbelow', 'E42:')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5004 call assert_fails('Xabove', 'E42:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5005 call assert_fails('Xbefore', 'E42:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5006 call assert_fails('Xafter', 'E42:')
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5007
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5008 " Empty quickfix/location list
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5009 call g:Xsetlist([])
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5010 call assert_fails('Xbelow', 'E42:')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5011 call assert_fails('Xabove', 'E42:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5012 call assert_fails('Xbefore', 'E42:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5013 call assert_fails('Xafter', 'E42:')
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5014
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5015 call s:create_test_file('X1')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5016 call s:create_test_file('X2')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5017 call s:create_test_file('X3')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5018 call s:create_test_file('X4')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5019
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5020 " Invalid entries
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5021 edit X1
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5022 call g:Xsetlist(["E1", "E2"])
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5023 call assert_fails('Xbelow', 'E42:')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5024 call assert_fails('Xabove', 'E42:')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5025 call assert_fails('3Xbelow', 'E42:')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5026 call assert_fails('4Xabove', 'E42:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5027 call assert_fails('Xbefore', 'E42:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5028 call assert_fails('Xafter', 'E42:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5029 call assert_fails('3Xbefore', 'E42:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5030 call assert_fails('4Xafter', 'E42:')
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5031
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5032 " Test the commands with various arguments
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5033 Xexpr ["X1:5:3:L5", "X2:5:2:L5", "X2:10:3:L10", "X2:15:4:L15", "X3:3:5:L3"]
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5034 edit +7 X2
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5035 Xabove
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5036 call assert_equal(['X2', 5], [@%, line('.')])
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5037 call assert_fails('Xabove', 'E553:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5038 normal 7G
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5039 Xbefore
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5040 call assert_equal(['X2', 5, 2], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5041 call assert_fails('Xbefore', 'E553:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5042
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5043 normal 2j
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5044 Xbelow
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5045 call assert_equal(['X2', 10], [@%, line('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5046 normal 7G
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5047 Xafter
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5048 call assert_equal(['X2', 10, 3], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5049
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5050 " Last error in this file
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5051 Xbelow 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5052 call assert_equal(['X2', 15], [@%, line('.')])
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5053 call assert_fails('Xbelow', 'E553:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5054 normal gg
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5055 Xafter 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5056 call assert_equal(['X2', 15, 4], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5057 call assert_fails('Xafter', 'E553:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5058
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5059 " First error in this file
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5060 Xabove 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5061 call assert_equal(['X2', 5], [@%, line('.')])
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5062 call assert_fails('Xabove', 'E553:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5063 normal G
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5064 Xbefore 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5065 call assert_equal(['X2', 5, 2], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5066 call assert_fails('Xbefore', 'E553:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5067
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5068 normal gg
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5069 Xbelow 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5070 call assert_equal(['X2', 10], [@%, line('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5071 normal gg
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5072 Xafter 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5073 call assert_equal(['X2', 10, 3], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5074
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5075 normal G
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5076 Xabove 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5077 call assert_equal(['X2', 10], [@%, line('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5078 normal G
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5079 Xbefore 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5080 call assert_equal(['X2', 10, 3], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5081
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5082 edit X4
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5083 call assert_fails('Xabove', 'E42:')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5084 call assert_fails('Xbelow', 'E42:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5085 call assert_fails('Xbefore', 'E42:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5086 call assert_fails('Xafter', 'E42:')
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5087 if a:cchar == 'l'
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5088 " If a buffer has location list entries from some other window but not
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5089 " from the current window, then the commands should fail.
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5090 edit X1 | split | call setloclist(0, [], 'f')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5091 call assert_fails('Xabove', 'E776:')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5092 call assert_fails('Xbelow', 'E776:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5093 call assert_fails('Xbefore', 'E776:')
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5094 call assert_fails('Xafter', 'E776:')
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5095 close
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5096 endif
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5097
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5098 " Test for lines with multiple quickfix entries
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5099 Xexpr ["X1:5:L5", "X2:5:1:L5_1", "X2:5:2:L5_2", "X2:5:3:L5_3",
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5100 \ "X2:10:1:L10_1", "X2:10:2:L10_2", "X2:10:3:L10_3",
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5101 \ "X2:15:1:L15_1", "X2:15:2:L15_2", "X2:15:3:L15_3", "X3:3:L3"]
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5102 edit +1 X2
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5103 Xbelow 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5104 call assert_equal(['X2', 10, 1], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5105 normal 1G
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5106 Xafter 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5107 call assert_equal(['X2', 5, 2], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5108
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5109 normal gg
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5110 Xbelow 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5111 call assert_equal(['X2', 15, 1], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5112 normal gg
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5113 Xafter 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5114 call assert_equal(['X2', 15, 3], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5115
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5116 normal G
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5117 Xabove 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5118 call assert_equal(['X2', 10, 1], [@%, line('.'), col('.')])
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5119 normal G
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5120 Xbefore 2
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5121 call assert_equal(['X2', 15, 2], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5122
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5123 normal G
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5124 Xabove 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5125 call assert_equal(['X2', 5, 1], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5126 normal G
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5127 Xbefore 99
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5128 call assert_equal(['X2', 5, 1], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5129
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5130 normal 10G
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5131 Xabove
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5132 call assert_equal(['X2', 5, 1], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5133 normal 10G$
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5134 2Xbefore
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5135 call assert_equal(['X2', 10, 2], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5136
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5137 normal 10G
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5138 Xbelow
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5139 call assert_equal(['X2', 15, 1], [@%, line('.'), col('.')])
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5140 normal 9G
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5141 5Xafter
20978
2c3e7a6bd6c6 patch 8.2.1040: not enough testing for movement commands
Bram Moolenaar <Bram@vim.org>
parents: 20814
diff changeset
5142 call assert_equal(['X2', 15, 2], [@%, line('.'), col('.')])
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5143
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5144 " Invalid range
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5145 if a:cchar == 'c'
16515
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5146 call assert_fails('-2cbelow', 'E16:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5147 call assert_fails('-2cafter', 'E16:')
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5148 else
16515
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5149 call assert_fails('-2lbelow', 'E16:')
16543
1d2b3bb35414 patch 8.1.1275: cannot navigate to errors before/after the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16515
diff changeset
5150 call assert_fails('-2lafter', 'E16:')
16505
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5151 endif
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5152
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5153 call delete('X1')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5154 call delete('X2')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5155 call delete('X3')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5156 call delete('X4')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5157 endfunc
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5158
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5159 func Test_cbelow()
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5160 call Xtest_below('c')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5161 call Xtest_below('l')
28e3ba82d8c8 patch 8.1.1256: cannot navigate through errors relative to the cursor
Bram Moolenaar <Bram@vim.org>
parents: 16483
diff changeset
5162 endfunc
16515
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5163
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5164 func Test_quickfix_count()
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5165 let commands = [
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5166 \ 'cNext',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5167 \ 'cNfile',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5168 \ 'cabove',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5169 \ 'cbelow',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5170 \ 'cfirst',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5171 \ 'clast',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5172 \ 'cnewer',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5173 \ 'cnext',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5174 \ 'cnfile',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5175 \ 'colder',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5176 \ 'cprevious',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5177 \ 'crewind',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5178 \
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5179 \ 'lNext',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5180 \ 'lNfile',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5181 \ 'labove',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5182 \ 'lbelow',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5183 \ 'lfirst',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5184 \ 'llast',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5185 \ 'lnewer',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5186 \ 'lnext',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5187 \ 'lnfile',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5188 \ 'lolder',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5189 \ 'lprevious',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5190 \ 'lrewind',
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5191 \ ]
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5192 for cmd in commands
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5193 call assert_fails('-1' .. cmd, 'E16:')
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5194 call assert_fails('.' .. cmd, 'E16:')
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5195 call assert_fails('%' .. cmd, 'E16:')
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5196 call assert_fails('$' .. cmd, 'E16:')
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5197 endfor
6e87a69b8e0c patch 8.1.1261: no error for quickfix commands with negative range
Bram Moolenaar <Bram@vim.org>
parents: 16505
diff changeset
5198 endfunc
18452
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5199
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5200 " Test for aborting quickfix commands using QuickFixCmdPre
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5201 func Xtest_qfcmd_abort(cchar)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5202 call s:setup_commands(a:cchar)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5203
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5204 call g:Xsetlist([], 'f')
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5205
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5206 " cexpr/lexpr
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5207 let e = ''
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5208 try
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5209 Xexpr ["F1:10:Line10", "F2:20:Line20"]
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5210 catch /.*/
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5211 let e = v:exception
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5212 endtry
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5213 call assert_equal('AbortCmd', e)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5214 call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5215
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5216 " cfile/lfile
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5217 call writefile(["F1:10:Line10", "F2:20:Line20"], 'Xfile1')
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5218 let e = ''
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5219 try
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5220 Xfile Xfile1
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5221 catch /.*/
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5222 let e = v:exception
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5223 endtry
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5224 call assert_equal('AbortCmd', e)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5225 call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5226 call delete('Xfile1')
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5227
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5228 " cgetbuffer/lgetbuffer
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5229 enew!
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5230 call append(0, ["F1:10:Line10", "F2:20:Line20"])
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5231 let e = ''
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5232 try
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5233 Xgetbuffer
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5234 catch /.*/
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5235 let e = v:exception
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5236 endtry
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5237 call assert_equal('AbortCmd', e)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5238 call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5239 enew!
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5240
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5241 " vimgrep/lvimgrep
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5242 let e = ''
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5243 try
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5244 Xvimgrep /func/ test_quickfix.vim
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5245 catch /.*/
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5246 let e = v:exception
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5247 endtry
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5248 call assert_equal('AbortCmd', e)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5249 call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5250
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5251 " helpgrep/lhelpgrep
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5252 let e = ''
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5253 try
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5254 Xhelpgrep quickfix
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5255 catch /.*/
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5256 let e = v:exception
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5257 endtry
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5258 call assert_equal('AbortCmd', e)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5259 call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5260
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5261 " grep/lgrep
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5262 if has('unix')
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5263 let e = ''
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5264 try
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5265 silent Xgrep func test_quickfix.vim
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5266 catch /.*/
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5267 let e = v:exception
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5268 endtry
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5269 call assert_equal('AbortCmd', e)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5270 call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5271 endif
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5272 endfunc
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5273
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5274 func Test_qfcmd_abort()
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5275 augroup QF_Test
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5276 au!
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5277 autocmd QuickFixCmdPre * throw "AbortCmd"
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5278 augroup END
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5279
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5280 call Xtest_qfcmd_abort('c')
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5281 call Xtest_qfcmd_abort('l')
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5282
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5283 augroup QF_Test
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5284 au!
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5285 augroup END
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5286 endfunc
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
5287
18635
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5288 " Test for using a file in one of the parent directories.
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5289 func Test_search_in_dirstack()
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5290 call mkdir('Xtestdir/a/b/c', 'p')
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5291 let save_cwd = getcwd()
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5292 call writefile(["X1_L1", "X1_L2"], 'Xtestdir/Xfile1')
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5293 call writefile(["X2_L1", "X2_L2"], 'Xtestdir/a/Xfile2')
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5294 call writefile(["X3_L1", "X3_L2"], 'Xtestdir/a/b/Xfile3')
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5295 call writefile(["X4_L1", "X4_L2"], 'Xtestdir/a/b/c/Xfile4')
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5296
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5297 let lines = "Entering dir Xtestdir\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5298 \ "Entering dir a\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5299 \ "Entering dir b\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5300 \ "Xfile2:2:X2_L2\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5301 \ "Leaving dir a\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5302 \ "Xfile1:2:X1_L2\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5303 \ "Xfile3:1:X3_L1\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5304 \ "Entering dir c\n" .
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5305 \ "Xfile4:2:X4_L2\n" .
18827
f98368dd6615 patch 8.1.2401: :cexpr does not handle | in expression
Bram Moolenaar <Bram@vim.org>
parents: 18740
diff changeset
5306 \ "Leaving dir c\n"
18635
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5307 set efm=%DEntering\ dir\ %f,%XLeaving\ dir\ %f,%f:%l:%m
18827
f98368dd6615 patch 8.1.2401: :cexpr does not handle | in expression
Bram Moolenaar <Bram@vim.org>
parents: 18740
diff changeset
5308 cexpr lines .. "Leaving dir Xtestdir|\n" | let next = 1
18635
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5309 call assert_equal(11, getqflist({'size' : 0}).size)
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5310 call assert_equal(4, getqflist({'idx' : 0}).idx)
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5311 call assert_equal('X2_L2', getline('.'))
18827
f98368dd6615 patch 8.1.2401: :cexpr does not handle | in expression
Bram Moolenaar <Bram@vim.org>
parents: 18740
diff changeset
5312 call assert_equal(1, next)
18635
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5313 cnext
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5314 call assert_equal(6, getqflist({'idx' : 0}).idx)
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5315 call assert_equal('X1_L2', getline('.'))
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5316 cnext
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5317 call assert_equal(7, getqflist({'idx' : 0}).idx)
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5318 call assert_equal(1, line('$'))
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5319 call assert_equal('', getline(1))
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5320 cnext
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5321 call assert_equal(9, getqflist({'idx' : 0}).idx)
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5322 call assert_equal(1, line('$'))
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5323 call assert_equal('', getline(1))
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5324
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5325 set efm&
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5326 exe 'cd ' . save_cwd
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5327 call delete('Xtestdir', 'rf')
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5328 endfunc
dfa87465287e patch 8.1.2310: no proper test for directory changes in quickfix
Bram Moolenaar <Bram@vim.org>
parents: 18452
diff changeset
5329
19069
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5330 " Test for :cquit
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5331 func Test_cquit()
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5332 " Exit Vim with a non-zero value
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5333 if RunVim([], ["cquit 7"], '')
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5334 call assert_equal(7, v:shell_error)
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5335 endif
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5336
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5337 if RunVim([], ["50cquit"], '')
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5338 call assert_equal(50, v:shell_error)
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5339 endif
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5340
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5341 " Exit Vim with default value
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5342 if RunVim([], ["cquit"], '')
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5343 call assert_equal(1, v:shell_error)
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5344 endif
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5345
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5346 " Exit Vim with zero value
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5347 if RunVim([], ["cquit 0"], '')
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5348 call assert_equal(0, v:shell_error)
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5349 endif
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5350
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5351 " Exit Vim with negative value
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5352 call assert_fails('-3cquit', 'E16:')
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5353 endfunc
e14feba578f1 patch 8.2.0095: cannot specify exit code for :cquit
Bram Moolenaar <Bram@vim.org>
parents: 18827
diff changeset
5354
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5355 " Test for getting a specific item from a quickfix list
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5356 func Xtest_getqflist_by_idx(cchar)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5357 call s:setup_commands(a:cchar)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5358 " Empty list
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5359 call assert_equal([], g:Xgetlist({'idx' : 1, 'items' : 0}).items)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5360 Xexpr ['F1:10:L10', 'F1:20:L20']
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5361 let l = g:Xgetlist({'idx' : 2, 'items' : 0}).items
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5362 call assert_equal(bufnr('F1'), l[0].bufnr)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5363 call assert_equal(20, l[0].lnum)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5364 call assert_equal('L20', l[0].text)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5365 call assert_equal([], g:Xgetlist({'idx' : -1, 'items' : 0}).items)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5366 call assert_equal([], g:Xgetlist({'idx' : 3, 'items' : 0}).items)
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5367 call assert_equal({}, g:Xgetlist(#{idx: "abc"}))
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5368 %bwipe!
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5369 endfunc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5370
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5371 func Test_getqflist_by_idx()
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5372 call Xtest_getqflist_by_idx('c')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5373 call Xtest_getqflist_by_idx('l')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5374 endfunc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5375
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5376 " Test for the 'quickfixtextfunc' setting
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5377 func Tqfexpr(info)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5378 if a:info.quickfix
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5379 let qfl = getqflist({'id' : a:info.id, 'items' : 1}).items
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5380 else
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5381 let qfl = getloclist(a:info.winid, {'id' : a:info.id, 'items' : 1}).items
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5382 endif
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5383
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5384 let l = []
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5385 for idx in range(a:info.start_idx - 1, a:info.end_idx - 1)
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5386 let e = qfl[idx]
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5387 let s = ''
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5388 if e.bufnr != 0
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5389 let bname = bufname(e.bufnr)
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5390 let s ..= fnamemodify(bname, ':.')
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5391 endif
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5392 let s ..= '-'
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5393 let s ..= 'L' .. string(e.lnum) .. 'C' .. string(e.col) .. '-'
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5394 let s ..= e.text
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5395 call add(l, s)
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5396 endfor
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5397
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5398 return l
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5399 endfunc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5400
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5401 func Xtest_qftextfunc(cchar)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5402 call s:setup_commands(a:cchar)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5403
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5404 set efm=%f:%l:%c:%m
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5405 set quickfixtextfunc=Tqfexpr
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5406 call assert_equal('Tqfexpr', &quickfixtextfunc)
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5407 call assert_equal('',
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5408 \ g:Xgetlist({'quickfixtextfunc' : 1}).quickfixtextfunc)
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5409 call g:Xsetlist([
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5410 \ { 'filename': 'F1', 'lnum': 10, 'col': 2,
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5411 \ 'end_col': 7, 'text': 'green'},
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5412 \ { 'filename': 'F1', 'lnum': 20, 'end_lnum': 25, 'col': 4,
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5413 \ 'end_col': 8, 'text': 'blue'},
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5414 \ ])
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5415
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5416 Xwindow
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5417 call assert_equal('F1-L10C2-green', getline(1))
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5418 call assert_equal('F1-L20C4-blue', getline(2))
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5419 Xclose
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5420 set quickfixtextfunc&vim
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5421 Xwindow
24964
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5422 call assert_equal('F1|10 col 2-7| green', getline(1))
f4aa891a5ab8 patch 8.2.3019: location list only has the start position.
Bram Moolenaar <Bram@vim.org>
parents: 24962
diff changeset
5423 call assert_equal('F1|20-25 col 4-8| blue', getline(2))
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5424 Xclose
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5425
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5426 set efm=%f:%l:%c:%m
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5427 set quickfixtextfunc=Tqfexpr
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5428 " Update the list with only the cwindow
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5429 Xwindow
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5430 only
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5431 call g:Xsetlist([
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5432 \ { 'filename': 'F2', 'lnum': 20, 'col': 2,
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5433 \ 'end_col': 7, 'text': 'red'}
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5434 \ ])
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5435 call assert_equal(['F2-L20C2-red'], getline(1, '$'))
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5436 new
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
5437 Xclose
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5438 set efm&
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5439 set quickfixtextfunc&
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5440
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5441 " Test for per list 'quickfixtextfunc' setting
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5442 func PerQfText(info)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5443 if a:info.quickfix
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5444 let qfl = getqflist({'id' : a:info.id, 'items' : 1}).items
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5445 else
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5446 let qfl = getloclist(a:info.winid, {'id' : a:info.id, 'items' : 1}).items
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5447 endif
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5448 if empty(qfl)
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5449 return []
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5450 endif
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5451 let l = []
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5452 for idx in range(a:info.start_idx - 1, a:info.end_idx - 1)
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5453 call add(l, 'Line ' .. qfl[idx].lnum .. ', Col ' .. qfl[idx].col)
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5454 endfor
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5455 return l
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5456 endfunc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5457 set quickfixtextfunc=Tqfexpr
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5458 call g:Xsetlist([], ' ', {'quickfixtextfunc' : "PerQfText"})
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5459 Xaddexpr ['F1:10:2:green', 'F1:20:4:blue']
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5460 Xwindow
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5461 call assert_equal('Line 10, Col 2', getline(1))
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5462 call assert_equal('Line 20, Col 4', getline(2))
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5463 Xclose
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5464 call assert_equal(function('PerQfText'),
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5465 \ g:Xgetlist({'quickfixtextfunc' : 1}).quickfixtextfunc)
20762
68170c89e355 patch 8.2.0933: 'quickfixtextfunc' does not get window ID of location list
Bram Moolenaar <Bram@vim.org>
parents: 20729
diff changeset
5466 " Add entries to the list when the quickfix buffer is hidden
68170c89e355 patch 8.2.0933: 'quickfixtextfunc' does not get window ID of location list
Bram Moolenaar <Bram@vim.org>
parents: 20729
diff changeset
5467 Xaddexpr ['F1:30:6:red']
68170c89e355 patch 8.2.0933: 'quickfixtextfunc' does not get window ID of location list
Bram Moolenaar <Bram@vim.org>
parents: 20729
diff changeset
5468 Xwindow
68170c89e355 patch 8.2.0933: 'quickfixtextfunc' does not get window ID of location list
Bram Moolenaar <Bram@vim.org>
parents: 20729
diff changeset
5469 call assert_equal('Line 30, Col 6', getline(3))
68170c89e355 patch 8.2.0933: 'quickfixtextfunc' does not get window ID of location list
Bram Moolenaar <Bram@vim.org>
parents: 20729
diff changeset
5470 Xclose
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5471 call g:Xsetlist([], 'r', {'quickfixtextfunc' : ''})
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5472 call assert_equal('', g:Xgetlist({'quickfixtextfunc' : 1}).quickfixtextfunc)
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5473 set quickfixtextfunc&
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5474 delfunc PerQfText
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5475
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5476 " Non-existing function
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5477 set quickfixtextfunc=Tabc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5478 call assert_fails("Xexpr ['F1:10:2:green', 'F1:20:4:blue']", 'E117:')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5479 call assert_fails("Xwindow", 'E117:')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5480 Xclose
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5481 set quickfixtextfunc&
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5482
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5483 " set option to a non-function
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5484 set quickfixtextfunc=[10,\ 20]
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5485 call assert_fails("Xexpr ['F1:10:2:green', 'F1:20:4:blue']", 'E117:')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5486 call assert_fails("Xwindow", 'E117:')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5487 Xclose
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5488 set quickfixtextfunc&
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5489
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5490 " set option to a function with different set of arguments
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5491 func Xqftext(a, b, c)
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5492 return a:a .. a:b .. a:c
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5493 endfunc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5494 set quickfixtextfunc=Xqftext
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5495 call assert_fails("Xexpr ['F1:10:2:green', 'F1:20:4:blue']", 'E119:')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5496 call assert_fails("Xwindow", 'E119:')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5497 Xclose
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5498
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5499 " set option to a function that returns a list with non-strings
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5500 func Xqftext2(d)
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5501 return ['one', [], 'two']
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5502 endfunc
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5503 set quickfixtextfunc=Xqftext2
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5504 call assert_fails("Xexpr ['F1:10:2:green', 'F1:20:4:blue', 'F1:30:6:red']",
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5505 \ 'E730:')
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5506 call assert_fails('Xwindow', 'E730:')
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5507 call assert_equal(['one', 'F1|20 col 4| blue', 'F1|30 col 6| red'],
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5508 \ getline(1, '$'))
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5509 Xclose
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5510
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5511 set quickfixtextfunc&
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5512 delfunc Xqftext
20814
f23c6543a54d patch 8.2.0959: using 'quickfixtextfunc' is a bit slow
Bram Moolenaar <Bram@vim.org>
parents: 20768
diff changeset
5513 delfunc Xqftext2
21409
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5514
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5515 " set the global option to a lambda function
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5516 set quickfixtextfunc={d\ ->\ map(g:Xgetlist({'id'\ :\ d.id,\ 'items'\ :\ 1}).items[d.start_idx-1:d.end_idx-1],\ 'v:val.text')}
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5517 Xexpr ['F1:10:2:green', 'F1:20:4:blue']
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5518 Xwindow
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5519 call assert_equal(['green', 'blue'], getline(1, '$'))
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5520 Xclose
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5521 call assert_equal("{d -> map(g:Xgetlist({'id' : d.id, 'items' : 1}).items[d.start_idx-1:d.end_idx-1], 'v:val.text')}", &quickfixtextfunc)
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5522 set quickfixtextfunc&
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5523
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5524 " use a lambda function that returns an empty list
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5525 set quickfixtextfunc={d\ ->\ []}
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5526 Xexpr ['F1:10:2:green', 'F1:20:4:blue']
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5527 Xwindow
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5528 call assert_equal(['F1|10 col 2| green', 'F1|20 col 4| blue'],
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5529 \ getline(1, '$'))
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5530 Xclose
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5531 set quickfixtextfunc&
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5532
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5533 " use a lambda function that returns a list with empty strings
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5534 set quickfixtextfunc={d\ ->\ ['',\ '']}
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5535 Xexpr ['F1:10:2:green', 'F1:20:4:blue']
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5536 Xwindow
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5537 call assert_equal(['F1|10 col 2| green', 'F1|20 col 4| blue'],
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5538 \ getline(1, '$'))
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5539 Xclose
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5540 set quickfixtextfunc&
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5541
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5542 " set the per-quickfix list text function to a lambda function
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5543 call g:Xsetlist([], ' ',
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5544 \ {'quickfixtextfunc' :
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5545 \ {d -> map(g:Xgetlist({'id' : d.id, 'items' : 1}).items[d.start_idx-1:d.end_idx-1],
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5546 \ "'Line ' .. v:val.lnum .. ', Col ' .. v:val.col")}})
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5547 Xaddexpr ['F1:10:2:green', 'F1:20:4:blue']
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5548 Xwindow
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5549 call assert_equal('Line 10, Col 2', getline(1))
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5550 call assert_equal('Line 20, Col 4', getline(2))
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5551 Xclose
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5552 call assert_match("function('<lambda>\\d\\+')", string(g:Xgetlist({'quickfixtextfunc' : 1}).quickfixtextfunc))
2c40e60017a8 patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents: 21265
diff changeset
5553 call g:Xsetlist([], 'f')
20631
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5554 endfunc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5555
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5556 func Test_qftextfunc()
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5557 call Xtest_qftextfunc('c')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5558 call Xtest_qftextfunc('l')
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5559 endfunc
d6827bd31d1d patch 8.2.0869: it is not possible to customize the quickfix window contents
Bram Moolenaar <Bram@vim.org>
parents: 20263
diff changeset
5560
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5561 func Test_qftextfunc_callback()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5562 let lines =<< trim END
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5563 set efm=%f:%l:%c:%m
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5564
26526
33d680d372aa patch 8.2.3792: setting *func options insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
5565 #" Test for using a function name
33d680d372aa patch 8.2.3792: setting *func options insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
5566 LET &qftf = 'g:Tqfexpr'
33d680d372aa patch 8.2.3792: setting *func options insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
5567 cexpr "F0:0:0:L0"
33d680d372aa patch 8.2.3792: setting *func options insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
5568 copen
33d680d372aa patch 8.2.3792: setting *func options insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
5569 call assert_equal('F0-L0C0-L0', getline(1))
33d680d372aa patch 8.2.3792: setting *func options insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
5570 cclose
33d680d372aa patch 8.2.3792: setting *func options insufficiently tested
Bram Moolenaar <Bram@vim.org>
parents: 26518
diff changeset
5571
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5572 #" Test for using a function()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5573 set qftf=function('g:Tqfexpr')
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5574 cexpr "F1:1:1:L1"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5575 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5576 call assert_equal('F1-L1C1-L1', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5577 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5578
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5579 #" Using a funcref variable to set 'quickfixtextfunc'
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5580 VAR Fn = function('g:Tqfexpr')
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5581 LET &qftf = Fn
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5582 cexpr "F2:2:2:L2"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5583 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5584 call assert_equal('F2-L2C2-L2', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5585 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5586
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5587 #" Using string(funcref_variable) to set 'quickfixtextfunc'
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5588 LET Fn = function('g:Tqfexpr')
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5589 LET &qftf = string(Fn)
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5590 cexpr "F3:3:3:L3"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5591 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5592 call assert_equal('F3-L3C3-L3', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5593 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5594
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5595 #" Test for using a funcref()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5596 set qftf=funcref('g:Tqfexpr')
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5597 cexpr "F4:4:4:L4"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5598 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5599 call assert_equal('F4-L4C4-L4', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5600 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5601
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5602 #" Using a funcref variable to set 'quickfixtextfunc'
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5603 LET Fn = funcref('g:Tqfexpr')
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5604 LET &qftf = Fn
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5605 cexpr "F5:5:5:L5"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5606 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5607 call assert_equal('F5-L5C5-L5', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5608 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5609
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5610 #" Using a string(funcref_variable) to set 'quickfixtextfunc'
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5611 LET Fn = funcref('g:Tqfexpr')
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5612 LET &qftf = string(Fn)
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5613 cexpr "F5:5:5:L5"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5614 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5615 call assert_equal('F5-L5C5-L5', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5616 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5617
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5618 #" Test for using a lambda function with set
27457
4c16acb2525f patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 26618
diff changeset
5619 VAR optval = "LSTART a LMIDDLE g:Tqfexpr(a) LEND"
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5620 LET optval = substitute(optval, ' ', '\\ ', 'g')
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5621 exe "set qftf=" .. optval
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5622 cexpr "F6:6:6:L6"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5623 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5624 call assert_equal('F6-L6C6-L6', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5625 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5626
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5627 #" Set 'quickfixtextfunc' to a lambda expression
27457
4c16acb2525f patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 26618
diff changeset
5628 LET &qftf = LSTART a LMIDDLE g:Tqfexpr(a) LEND
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5629 cexpr "F7:7:7:L7"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5630 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5631 call assert_equal('F7-L7C7-L7', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5632 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5633
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5634 #" Set 'quickfixtextfunc' to string(lambda_expression)
27457
4c16acb2525f patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 26618
diff changeset
5635 LET &qftf = "LSTART a LMIDDLE g:Tqfexpr(a) LEND"
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5636 cexpr "F8:8:8:L8"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5637 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5638 call assert_equal('F8-L8C8-L8', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5639 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5640
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5641 #" Set 'quickfixtextfunc' to a variable with a lambda expression
27457
4c16acb2525f patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 26618
diff changeset
5642 VAR Lambda = LSTART a LMIDDLE g:Tqfexpr(a) LEND
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5643 LET &qftf = Lambda
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5644 cexpr "F9:9:9:L9"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5645 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5646 call assert_equal('F9-L9C9-L9', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5647 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5648
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5649 #" Set 'quickfixtextfunc' to a string(variable with a lambda expression)
27457
4c16acb2525f patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 26618
diff changeset
5650 LET Lambda = LSTART a LMIDDLE g:Tqfexpr(a) LEND
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5651 LET &qftf = string(Lambda)
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5652 cexpr "F9:9:9:L9"
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5653 copen
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5654 call assert_equal('F9-L9C9-L9', getline(1))
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5655 cclose
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5656 END
27457
4c16acb2525f patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 26618
diff changeset
5657 call v9.CheckLegacyAndVim9Success(lines)
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5658
26618
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5659 " Test for using a script-local function name
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5660 func s:TqfFunc2(info)
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5661 let g:TqfFunc2Args = [a:info.start_idx, a:info.end_idx]
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5662 return ''
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5663 endfunc
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5664 let g:TqfFunc2Args = []
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5665 set quickfixtextfunc=s:TqfFunc2
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5666 cexpr "F10:10:10:L10"
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5667 cclose
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5668 call assert_equal([1, 1], g:TqfFunc2Args)
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5669
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5670 let &quickfixtextfunc = 's:TqfFunc2'
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5671 cexpr "F11:11:11:L11"
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5672 cclose
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5673 call assert_equal([1, 1], g:TqfFunc2Args)
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5674 delfunc s:TqfFunc2
b531c26f728b patch 8.2.3838: cannot use script-local function for setting *func options
Bram Moolenaar <Bram@vim.org>
parents: 26568
diff changeset
5675
26518
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5676 " set 'quickfixtextfunc' to a partial with dict. This used to cause a crash.
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5677 func SetQftfFunc()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5678 let params = {'qftf': function('g:DictQftfFunc')}
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5679 let &quickfixtextfunc = params.qftf
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5680 endfunc
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5681 func g:DictQftfFunc(_) dict
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5682 endfunc
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5683 call SetQftfFunc()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5684 new
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5685 call SetQftfFunc()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5686 bw
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5687 call test_garbagecollect_now()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5688 new
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5689 set qftf=
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5690 wincmd w
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5691 set qftf=
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5692 :%bw!
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5693
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5694 " set per-quickfix list 'quickfixtextfunc' to a partial with dict. This used
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5695 " to cause a crash.
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5696 let &qftf = ''
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5697 func SetLocalQftfFunc()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5698 let params = {'qftf': function('g:DictQftfFunc')}
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5699 call setqflist([], 'a', {'quickfixtextfunc' : params.qftf})
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5700 endfunc
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5701 call SetLocalQftfFunc()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5702 call test_garbagecollect_now()
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5703 call setqflist([], 'a', {'quickfixtextfunc' : ''})
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5704 delfunc g:DictQftfFunc
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5705 delfunc SetQftfFunc
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5706 delfunc SetLocalQftfFunc
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5707 set efm&
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5708 endfunc
13ba00ef7687 patch 8.2.3788: lambda for option that is a function may be freed
Bram Moolenaar <Bram@vim.org>
parents: 26464
diff changeset
5709
24962
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5710 " Test for updating a location list for some other window and check that
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5711 " 'qftextfunc' uses the correct location list.
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5712 func Test_qftextfunc_other_loclist()
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5713 %bw!
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5714 call setloclist(0, [], 'f')
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5715
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5716 " create a window and a location list for it and open the location list
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5717 " window
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5718 lexpr ['F1:10:12:one', 'F1:20:14:two']
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5719 let w1_id = win_getid()
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5720 call setloclist(0, [], ' ',
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5721 \ {'lines': ['F1:10:12:one', 'F1:20:14:two'],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5722 \ 'quickfixtextfunc':
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5723 \ {d -> map(getloclist(d.winid, {'id' : d.id,
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5724 \ 'items' : 1}).items[d.start_idx-1:d.end_idx-1],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5725 \ "'Line ' .. v:val.lnum .. ', Col ' .. v:val.col")}})
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5726 lwindow
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5727 let w2_id = win_getid()
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5728
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5729 " create another window and a location list for it and open the location
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5730 " list window
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5731 topleft new
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5732 let w3_id = win_getid()
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5733 call setloclist(0, [], ' ',
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5734 \ {'lines': ['F2:30:32:eleven', 'F2:40:34:twelve'],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5735 \ 'quickfixtextfunc':
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5736 \ {d -> map(getloclist(d.winid, {'id' : d.id,
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5737 \ 'items' : 1}).items[d.start_idx-1:d.end_idx-1],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5738 \ "'Ligne ' .. v:val.lnum .. ', Colonne ' .. v:val.col")}})
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5739 lwindow
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5740 let w4_id = win_getid()
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5741
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5742 topleft new
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5743 lexpr ['F3:50:52:green', 'F3:60:54:blue']
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5744 let w5_id = win_getid()
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5745
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5746 " change the location list for some other window
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5747 call setloclist(0, [], 'r', {'lines': ['F3:55:56:aaa', 'F3:57:58:bbb']})
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5748 call setloclist(w1_id, [], 'r', {'lines': ['F1:62:63:bbb', 'F1:64:65:ccc']})
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5749 call setloclist(w3_id, [], 'r', {'lines': ['F2:76:77:ddd', 'F2:78:79:eee']})
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5750 call assert_equal(['Line 62, Col 63', 'Line 64, Col 65'],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5751 \ getbufline(winbufnr(w2_id), 1, '$'))
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5752 call assert_equal(['Ligne 76, Colonne 77', 'Ligne 78, Colonne 79'],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5753 \ getbufline(winbufnr(w4_id), 1, '$'))
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5754 call setloclist(w2_id, [], 'r', {'lines': ['F1:32:33:fff', 'F1:34:35:ggg']})
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5755 call setloclist(w4_id, [], 'r', {'lines': ['F2:46:47:hhh', 'F2:48:49:jjj']})
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5756 call assert_equal(['Line 32, Col 33', 'Line 34, Col 35'],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5757 \ getbufline(winbufnr(w2_id), 1, '$'))
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5758 call assert_equal(['Ligne 46, Colonne 47', 'Ligne 48, Colonne 49'],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5759 \ getbufline(winbufnr(w4_id), 1, '$'))
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5760
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5761 call win_gotoid(w5_id)
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5762 lwindow
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5763 call assert_equal(['F3|55 col 56| aaa', 'F3|57 col 58| bbb'],
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5764 \ getline(1, '$'))
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5765 %bw!
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5766 endfunc
437b8be91993 patch 8.2.3018: 'quickfixtextfunc' formatting is lost when switching buffers
Bram Moolenaar <Bram@vim.org>
parents: 24590
diff changeset
5767
20764
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5768 " Running :lhelpgrep command more than once in a help window, doesn't jump to
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5769 " the help topic
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5770 func Test_lhelpgrep_from_help_window()
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5771 call mkdir('Xtestdir/doc', 'p')
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5772 call writefile(['window'], 'Xtestdir/doc/a.txt')
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5773 call writefile(['buffer'], 'Xtestdir/doc/b.txt')
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5774 let save_rtp = &rtp
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5775 let &rtp = 'Xtestdir'
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5776 lhelpgrep window
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5777 lhelpgrep buffer
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5778 call assert_equal('b.txt', fnamemodify(@%, ":p:t"))
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5779 lhelpgrep window
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5780 call assert_equal('a.txt', fnamemodify(@%, ":p:t"))
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5781 let &rtp = save_rtp
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5782 call delete('Xtestdir', 'rf')
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5783 new | only!
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5784 endfunc
3c61d8ec36af patch 8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic
Bram Moolenaar <Bram@vim.org>
parents: 20762
diff changeset
5785
21741
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5786 " Test for the crash fixed by 7.3.715
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5787 func Test_setloclist_crash()
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5788 %bw!
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5789 let g:BufNum = bufnr()
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5790 augroup QF_Test
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5791 au!
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5792 au BufUnload * call setloclist(0, [{'bufnr':g:BufNum, 'lnum':1, 'col':1, 'text': 'tango down'}])
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5793 augroup END
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5794
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5795 try
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5796 lvimgrep /.*/ *.mak
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5797 catch /E926:/
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5798 endtry
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5799 call assert_equal('tango down', getloclist(0, {'items' : 0}).items[0].text)
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5800 call assert_equal(1, getloclist(0, {'size' : 0}).size)
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5801
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5802 augroup QF_Test
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5803 au!
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5804 augroup END
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5805 unlet g:BufNum
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5806 %bw!
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5807 endfunc
baccf9e06efe patch 8.2.1420: test 49 is old style
Bram Moolenaar <Bram@vim.org>
parents: 21668
diff changeset
5808
22870
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5809 " Test for adding an invalid entry with the quickfix window open and making
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5810 " sure that the window contents are not changed
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5811 func Test_add_invalid_entry_with_qf_window()
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5812 call setqflist([], 'f')
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5813 cexpr "Xfile1:10:aa"
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5814 copen
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5815 call setqflist(['bb'], 'a')
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5816 call assert_equal(1, line('$'))
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5817 call assert_equal(['Xfile1|10| aa'], getline(1, '$'))
24976
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5818 call assert_equal([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5819
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5820 call setqflist([{'lnum': 10 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5821 call assert_equal(1 , line('$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5822 call assert_equal(['Xfile1|10| aa'] , getline(1 , '$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5823 call assert_equal([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5824
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5825 call setqflist([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5826 call assert_equal(1 , line('$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5827 call assert_equal(['Xfile1|10| aa'] , getline(1 , '$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5828 call assert_equal([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5829
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5830 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5831 call assert_equal(1 , line('$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5832 call assert_equal(['Xfile1|10| aa'] , getline(1 , '$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5833 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5834
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5835 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5836 call assert_equal(1 , line('$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5837 call assert_equal(['Xfile1|10 col 666| aa'] , getline(1 , '$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5838 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5839
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5840 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5841 call assert_equal(1 , line('$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5842 call assert_equal(['Xfile1|10 col 666| aa'] , getline(1 , '$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5843 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5844
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5845 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5846 call assert_equal(1 , line('$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5847 call assert_equal(['Xfile1|10 col 666-222| aa'] , getline(1 , '$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5848 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5849
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5850 call setqflist([{'lnum': 10 , 'end_lnum': 6 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5851 call assert_equal(1 , line('$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5852 call assert_equal(['Xfile1|10-6 col 666-222| aa'] , getline(1 , '$'))
fd205e78e163 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum
Bram Moolenaar <Bram@vim.org>
parents: 24964
diff changeset
5853 call assert_equal([{'lnum': 10 , 'end_lnum': 6 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
22870
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5854 cclose
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5855 endfunc
69b48d2822ec patch 8.2.1982: quickfix window now updated when adding invalid entries
Bram Moolenaar <Bram@vim.org>
parents: 22788
diff changeset
5856
22979
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5857 " Test for very weird problem: autocommand causes a failure, resulting opening
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5858 " the quickfix window to fail. This still splits the window, but otherwise
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5859 " should not mess up buffers.
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5860 func Test_quickfix_window_fails_to_open()
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5861 CheckScreendump
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5862
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5863 let lines =<< trim END
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5864 anything
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5865 try
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5866 anything
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5867 endtry
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5868 END
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5869 call writefile(lines, 'XquickfixFails')
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5870
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5871 let lines =<< trim END
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5872 split XquickfixFails
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5873 silent vimgrep anything %
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5874 normal o
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5875 au BufLeave * ++once source XquickfixFails
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5876 " This will trigger the autocommand, which causes an error, what follows
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5877 " is aborted but the window was already split.
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5878 silent! cwindow
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5879 END
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5880 call writefile(lines, 'XtestWinFails')
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5881 let buf = RunVimInTerminal('-S XtestWinFails', #{rows: 13})
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5882 call VerifyScreenDump(buf, 'Test_quickfix_window_fails', {})
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5883
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5884 " clean up
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5885 call term_sendkeys(buf, ":bwipe!\<CR>")
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5886 call term_wait(buf)
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5887 call StopVimInTerminal(buf)
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5888 call delete('XtestWinFails')
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5889 call delete('XquickfixFails')
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5890 endfunc
fab8455af19c patch 8.2.2036: buffer messed up if creating the quickfix window fails
Bram Moolenaar <Bram@vim.org>
parents: 22874
diff changeset
5891
23092
c713358da074 patch 8.2.2092: Vim9: unpredictable errors for script tests
Bram Moolenaar <Bram@vim.org>
parents: 23045
diff changeset
5892 " Test for updating the quickfix buffer whenever the associated quickfix list
23045
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5893 " is changed.
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5894 func Xqfbuf_update(cchar)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5895 call s:setup_commands(a:cchar)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5896
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5897 Xexpr "F1:1:line1"
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5898 Xopen
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5899 call assert_equal(['F1|1| line1'], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5900 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5901
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5902 " Test setqflist() using the 'lines' key in 'what'
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5903 " add a new entry
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5904 call g:Xsetlist([], 'a', {'lines' : ['F2:2: line2']})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5905 call assert_equal(['F1|1| line1', 'F2|2| line2'], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5906 call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5907 " replace all the entries with a single entry
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5908 call g:Xsetlist([], 'r', {'lines' : ['F3:3: line3']})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5909 call assert_equal(['F3|3| line3'], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5910 call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5911 " remove all the entries
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5912 call g:Xsetlist([], 'r', {'lines' : []})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5913 call assert_equal([''], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5914 call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5915 " add a new list
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5916 call g:Xsetlist([], ' ', {'lines' : ['F4:4: line4']})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5917 call assert_equal(['F4|4| line4'], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5918 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5919
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5920 " Test setqflist() using the 'items' key in 'what'
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5921 " add a new entry
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5922 call g:Xsetlist([], 'a', {'items' : [{'filename' : 'F5', 'lnum' : 5, 'text' : 'line5'}]})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5923 call assert_equal(['F4|4| line4', 'F5|5| line5'], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5924 call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5925 " replace all the entries with a single entry
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5926 call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F6', 'lnum' : 6, 'text' : 'line6'}]})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5927 call assert_equal(['F6|6| line6'], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5928 call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5929 " remove all the entries
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5930 call g:Xsetlist([], 'r', {'items' : []})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5931 call assert_equal([''], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5932 call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5933 " add a new list
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5934 call g:Xsetlist([], ' ', {'items' : [{'filename' : 'F7', 'lnum' : 7, 'text' : 'line7'}]})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5935 call assert_equal(['F7|7| line7'], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5936 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5937
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5938 call g:Xsetlist([], ' ', {})
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5939 call assert_equal([''], getline(1, '$'))
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5940 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5941
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5942 Xclose
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5943 endfunc
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5944
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5945 func Test_qfbuf_update()
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5946 call Xqfbuf_update('c')
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5947 call Xqfbuf_update('l')
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5948 endfunc
450d6e4992e1 patch 8.2.2069: the quickfix window is not updated after setqflist()
Bram Moolenaar <Bram@vim.org>
parents: 22979
diff changeset
5949
24059
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5950 func Test_vimgrep_noswapfile()
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5951 set noswapfile
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5952 call writefile(['one', 'two', 'three'], 'Xgreppie')
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5953 vimgrep two Xgreppie
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5954 call assert_equal('two', getline('.'))
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5955
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5956 call delete('Xgreppie')
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5957 set swapfile
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5958 endfunc
24887299c5ff patch 8.2.2571: test may leave file behind
Bram Moolenaar <Bram@vim.org>
parents: 23938
diff changeset
5959
24547
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5960 " Test for the :vimgrep 'f' flag (fuzzy match)
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5961 func Xvimgrep_fuzzy_match(cchar)
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5962 call s:setup_commands(a:cchar)
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5963
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5964 Xvimgrep /three one/f Xfile*
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5965 let l = g:Xgetlist()
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5966 call assert_equal(2, len(l))
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5967 call assert_equal(['Xfile1', 1, 9, 'one two three'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5968 \ [bufname(l[0].bufnr), l[0].lnum, l[0].col, l[0].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5969 call assert_equal(['Xfile2', 2, 1, 'three one two'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5970 \ [bufname(l[1].bufnr), l[1].lnum, l[1].col, l[1].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5971
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5972 Xvimgrep /the/f Xfile*
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5973 let l = g:Xgetlist()
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5974 call assert_equal(3, len(l))
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5975 call assert_equal(['Xfile1', 1, 9, 'one two three'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5976 \ [bufname(l[0].bufnr), l[0].lnum, l[0].col, l[0].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5977 call assert_equal(['Xfile2', 2, 1, 'three one two'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5978 \ [bufname(l[1].bufnr), l[1].lnum, l[1].col, l[1].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5979 call assert_equal(['Xfile2', 4, 4, 'aaathreeaaa'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5980 \ [bufname(l[2].bufnr), l[2].lnum, l[2].col, l[2].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5981
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5982 Xvimgrep /aaa/fg Xfile*
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5983 let l = g:Xgetlist()
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5984 call assert_equal(4, len(l))
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5985 call assert_equal(['Xfile1', 2, 1, 'aaaaaa'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5986 \ [bufname(l[0].bufnr), l[0].lnum, l[0].col, l[0].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5987 call assert_equal(['Xfile1', 2, 4, 'aaaaaa'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5988 \ [bufname(l[1].bufnr), l[1].lnum, l[1].col, l[1].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5989 call assert_equal(['Xfile2', 4, 1, 'aaathreeaaa'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5990 \ [bufname(l[2].bufnr), l[2].lnum, l[2].col, l[2].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5991 call assert_equal(['Xfile2', 4, 9, 'aaathreeaaa'],
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5992 \ [bufname(l[3].bufnr), l[3].lnum, l[3].col, l[3].text])
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5993
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5994 call assert_fails('Xvimgrep /xyz/fg Xfile*', 'E480:')
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5995 endfunc
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5996
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5997 func Test_vimgrep_fuzzy_match()
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5998 call writefile(['one two three', 'aaaaaa'], 'Xfile1')
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
5999 call writefile(['one', 'three one two', 'two', 'aaathreeaaa'], 'Xfile2')
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
6000 call Xvimgrep_fuzzy_match('c')
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
6001 call Xvimgrep_fuzzy_match('l')
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
6002 call delete('Xfile1')
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
6003 call delete('Xfile2')
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
6004 endfunc
192058cad081 patch 8.2.2813: cannot grep using fuzzy matching
Bram Moolenaar <Bram@vim.org>
parents: 24059
diff changeset
6005
25254
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6006 func Test_locationlist_open_in_newtab()
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6007 call s:create_test_file('Xqftestfile1')
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6008 call s:create_test_file('Xqftestfile2')
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6009 call s:create_test_file('Xqftestfile3')
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6010
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6011 %bwipe!
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6012
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6013 lgetexpr ['Xqftestfile1:5:Line5',
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6014 \ 'Xqftestfile2:10:Line10',
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6015 \ 'Xqftestfile3:16:Line16']
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6016
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6017 silent! llast
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6018 call assert_equal(1, tabpagenr('$'))
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6019 call assert_equal('Xqftestfile3', bufname())
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6020
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6021 set switchbuf=newtab
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6022
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6023 silent! lfirst
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6024 call assert_equal(2, tabpagenr('$'))
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6025 call assert_equal('Xqftestfile1', bufname())
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6026
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6027 silent! lnext
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6028 call assert_equal(3, tabpagenr('$'))
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6029 call assert_equal('Xqftestfile2', bufname())
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6030
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6031 call delete('Xqftestfile1')
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6032 call delete('Xqftestfile2')
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6033 call delete('Xqftestfile3')
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6034 set switchbuf&vim
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6035
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6036 %bwipe!
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6037 endfunc
5127844b909b patch 8.2.3163: location list window may open a wrong file
Bram Moolenaar <Bram@vim.org>
parents: 24976
diff changeset
6038
25435
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6039 " Test for win_gettype() in quickfix and location list windows
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6040 func Test_win_gettype()
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6041 copen
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6042 call assert_equal("quickfix", win_gettype())
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6043 let wid = win_getid()
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6044 wincmd p
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6045 call assert_equal("quickfix", win_gettype(wid))
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6046 cclose
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6047 lexpr ''
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6048 lopen
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6049 call assert_equal("loclist", win_gettype())
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6050 let wid = win_getid()
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6051 wincmd p
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6052 call assert_equal("loclist", win_gettype(wid))
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6053 lclose
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6054 endfunc
6ad76124ddda patch 8.2.3254: win_gettype() does not recognize a quickfix window
Bram Moolenaar <Bram@vim.org>
parents: 25254
diff changeset
6055
26364
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6056 fun Test_vimgrep_nomatch()
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6057 call XexprTests('c')
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6058 call g:Xsetlist([{'lnum':10,'text':'Line1'}])
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6059 copen
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6060 if has("win32")
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6061 call assert_fails('vimgrep foo *.zzz', 'E479:')
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6062 let expected = [{'lnum': 10, 'bufnr': 0, 'end_lnum': 0, 'pattern': '', 'valid': 0, 'vcol': 0, 'nr': 0, 'module': '', 'type': '', 'end_col': 0, 'col': 0, 'text': 'Line1'}]
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6063 else
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6064 call assert_fails('vimgrep foo *.zzz', 'E480:')
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6065 let expected = []
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6066 endif
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6067 call assert_equal(expected, getqflist())
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6068 cclose
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6069 endfunc
baf0d27eb024 patch 8.2.3713: MS-Windows: no error if vimgrep pattern is not matching
Bram Moolenaar <Bram@vim.org>
parents: 26211
diff changeset
6070
26458
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6071 " Test for opening the quickfix window in two tab pages and then closing one
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6072 " of the quickfix windows. This should not make the quickfix buffer unlisted.
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6073 " (github issue #9300).
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6074 func Test_two_qf_windows()
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6075 cexpr "F1:1:line1"
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6076 copen
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6077 tabnew
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6078 copen
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6079 call assert_true(&buflisted)
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6080 cclose
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6081 tabfirst
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6082 call assert_true(&buflisted)
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6083 let bnum = bufnr()
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6084 cclose
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6085 " if all the quickfix windows are closed, then buffer should be unlisted.
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6086 call assert_false(buflisted(bnum))
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6087 %bw!
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6088
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6089 " Repeat the test for a location list
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6090 lexpr "F2:2:line2"
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6091 lopen
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6092 let bnum = bufnr()
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6093 tabnew
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6094 exe "buffer" bnum
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6095 tabfirst
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6096 lclose
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6097 tablast
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6098 call assert_true(buflisted(bnum))
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6099 tabclose
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6100 lopen
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6101 call assert_true(buflisted(bnum))
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6102 lclose
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6103 call assert_false(buflisted(bnum))
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6104 %bw!
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6105 endfunc
824fe105f5b9 patch 8.2.3759: quickfix buffer becomes hidden while still in a window
Bram Moolenaar <Bram@vim.org>
parents: 26364
diff changeset
6106
27507
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6107 " Weird sequence of commands that caused entering a wiped-out buffer
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6108 func Test_lopen_bwipe()
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6109 func R()
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6110 silent! tab lopen
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6111 e x
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6112 silent! lfile
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6113 endfunc
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6114
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6115 cal R()
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6116 cal R()
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6117 cal R()
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6118 bw!
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6119 delfunc R
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6120 endfunc
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6121
27601
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6122 " Another sequence of commands that caused all buffers to be wiped out
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6123 func Test_lopen_bwipe_all()
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6124 let lines =<< trim END
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6125 func R()
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6126 silent! tab lopen
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6127 e foo
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6128 silent! lfile
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6129 endfunc
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6130 cal R()
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6131 exe "norm \<C-W>\<C-V>0"
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6132 cal R()
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6133 bwipe
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6134
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6135 call writefile(['done'], 'Xresult')
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6136 qall!
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6137 END
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6138 call writefile(lines, 'Xscript')
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6139 if RunVim([], [], '-u NONE -n -X -Z -e -m -s -S Xscript')
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6140 call assert_equal(['done'], readfile('Xresult'))
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6141 endif
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6142
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6143 call delete('Xscript')
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6144 call delete('Xresult')
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6145 endfunc
cb46dd386990 patch 8.2.4327: may end up with no current buffer
Bram Moolenaar <Bram@vim.org>
parents: 27507
diff changeset
6146
27873
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6147 " Test for calling setqflist() function recursively
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6148 func Test_recursive_setqflist()
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6149 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6150 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6151 autocmd BufWinEnter quickfix call setqflist([], 'r')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6152 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6153
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6154 copen
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6155 call assert_fails("call setqflist([], 'a')", 'E952:')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6156
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6157 augroup QF_Test
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6158 au!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6159 augroup END
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6160 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6161 endfunc
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6162
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6163 " Test for failure to create a new window when selecting a file from the
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6164 " quickfix window
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6165 func Test_cwindow_newwin_fails()
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6166 cgetexpr ["Xfile1:10:L10", "Xfile1:20:L20"]
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6167 cwindow
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6168 only
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6169 let qf_wid = win_getid()
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6170 " create the maximum number of scratch windows
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6171 let hor_win_count = (&lines - 1)/2
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6172 let hor_split_count = hor_win_count - 1
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6173 for s in range(1, hor_split_count) | new | set buftype=nofile | endfor
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6174 call win_gotoid(qf_wid)
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6175 call assert_fails('exe "normal \<CR>"', 'E36:')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6176 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6177 endfunc
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6178
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6179 " Test for updating the location list when only the location list window is
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6180 " present and the corresponding file window is closed.
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6181 func Test_loclist_update_with_llwin_only()
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6182 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6183 new
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6184 wincmd w
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6185 lexpr ["Xfile1:1:Line1"]
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6186 lopen
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6187 wincmd p
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6188 close
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6189 call setloclist(2, [], 'r', {'lines': ["Xtest2:2:Line2"]})
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6190 call assert_equal(['Xtest2|2| Line2'], getbufline(winbufnr(2), 1, '$'))
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6191 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6192 endfunc
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6193
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6194 " Test for getting the quickfix list after a buffer with an error is wiped out
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6195 func Test_getqflist_wiped_out_buffer()
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6196 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6197 cexpr ["Xtest1:34:Wiped out"]
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6198 let bnum = bufnr('Xtest1')
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6199 call assert_equal(bnum, getqflist()[0].bufnr)
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6200 bw Xtest1
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6201 call assert_equal(0, getqflist()[0].bufnr)
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6202 %bw!
d1af65b322d0 patch 8.2.4462: not enough testing for quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 27855
diff changeset
6203 endfunc
27507
b8a5de86e9d1 patch 8.2.4281: using freed memory with :lopen and :bwipe
Bram Moolenaar <Bram@vim.org>
parents: 27457
diff changeset
6204
28183
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6205 " Test for the status message that is displayed when opening a new quickfix
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6206 " list
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6207 func Test_qflist_statusmsg()
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6208 cexpr "1\n2"
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6209 cexpr "1\n2\n3\ntest_quickfix.vim:1:msg"
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6210 call assert_equal('(4 of 4): msg', v:statusmsg)
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6211 call setqflist([], 'f')
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6212 %bw!
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6213
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6214 " When creating a new quickfix list, if an autocmd changes the quickfix list
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6215 " in the stack, then an error message should be displayed.
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6216 augroup QF_Test
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6217 au!
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6218 au BufEnter test_quickfix.vim colder
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6219 augroup END
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6220 cexpr "1\n2"
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6221 call assert_fails('cexpr "1\n2\n3\ntest_quickfix.vim:1:msg"', 'E925:')
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6222 call setqflist([], 'f')
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6223 augroup QF_Test
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6224 au!
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6225 augroup END
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6226 %bw!
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6227
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6228 augroup QF_Test
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6229 au!
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6230 au BufEnter test_quickfix.vim caddexpr "4"
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6231 augroup END
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6232 call assert_fails('cexpr "1\n2\n3\ntest_quickfix.vim:1:msg"', 'E925:')
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6233 call setqflist([], 'f')
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6234 augroup QF_Test
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6235 au!
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6236 augroup END
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6237 %bw!
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6238 endfunc
2b595cee4c85 patch 8.2.4617: no completion for :scriptnames
Bram Moolenaar <Bram@vim.org>
parents: 27897
diff changeset
6239
18452
0ac9e720a56e patch 8.1.2220: :cfile does not abort like other quickfix commands
Bram Moolenaar <Bram@vim.org>
parents: 18319
diff changeset
6240 " vim: shiftwidth=2 sts=2 expandtab