annotate src/testdir/test_quickfix.vim @ 14976:676db1b7fc35 v8.1.0499

patch 8.1.0499: :2vimgrep causes an ml_get error commit https://github.com/vim/vim/commit/1c29943416207e21abbc790eaf563b36789170c2 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 28 14:36:09 2018 +0100 patch 8.1.0499: :2vimgrep causes an ml_get error Problem: :2vimgrep causes an ml_get error Solution: Pass tomatch pointer instead of value. (Yegappan Lakshmanan)
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Oct 2018 14:45:05 +0100
parents 940def6df43f
children 3a3c9b638187
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test for the quickfix commands.
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 if !has('quickfix')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 finish
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 endif
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
8649
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
7 set encoding=utf-8
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
8
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
9 func s:setup_commands(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
10 if a:cchar == 'c'
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
11 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
12 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
13 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
14 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
15 command! -nargs=* Xnewer <mods>cnewer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
16 command! -nargs=* Xopen <mods>copen <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
17 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
18 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
19 command! -nargs=* Xclose <mods>cclose <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
20 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
21 command! -nargs=* Xgetfile <mods>cgetfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
22 command! -nargs=* Xaddfile <mods>caddfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
23 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
24 command! -nargs=* Xgetbuffer <mods>cgetbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
25 command! -nargs=* Xaddbuffer <mods>caddbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
26 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
27 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
28 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
29 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
30 command! -nargs=* -bang Xlast <mods>clast<bang> <args>
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
31 command! -nargs=* -bang -range 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
32 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
33 command! -nargs=* Xexpr <mods>cexpr <args>
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
34 command! -range -nargs=* Xvimgrep <mods><count>vimgrep <args>
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
35 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
36 command! -nargs=* Xgrep <mods> grep <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
37 command! -nargs=* Xgrepadd <mods> grepadd <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
38 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
39 command! -nargs=0 -count Xcc <count>cc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
40 let g:Xgetlist = function('getqflist')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
41 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
42 call setqflist([], 'f')
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
43 else
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
44 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
45 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
46 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
47 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
48 command! -nargs=* Xnewer <mods>lnewer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
49 command! -nargs=* Xopen <mods>lopen <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
50 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
51 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
52 command! -nargs=* Xclose <mods>lclose <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
53 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
54 command! -nargs=* Xgetfile <mods>lgetfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
55 command! -nargs=* Xaddfile <mods>laddfile <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
56 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
57 command! -nargs=* Xgetbuffer <mods>lgetbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
58 command! -nargs=* Xaddbuffer <mods>laddbuffer <args>
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
59 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
60 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
61 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
62 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
63 command! -nargs=* -bang Xlast <mods>llast<bang> <args>
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
64 command! -nargs=* -bang -range 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
65 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
66 command! -nargs=* Xexpr <mods>lexpr <args>
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
67 command! -range -nargs=* Xvimgrep <mods><count>lvimgrep <args>
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
68 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
69 command! -nargs=* Xgrep <mods> lgrep <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
70 command! -nargs=* Xgrepadd <mods> lgrepadd <args>
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
71 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
72 command! -nargs=0 -count Xcc <count>ll
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
73 let g:Xgetlist = function('getloclist', [0])
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
74 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
75 call setloclist(0, [], 'f')
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
76 endif
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
77 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
78
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 " 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
80 func XlistTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
81 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
83 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
84 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
85 endif
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 " 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
87 Xgetexpr []
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
88 silent! Xlist
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 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
90
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 " 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
92 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
93 \ 'non-error 2', 'Xtestfile2:2:2:Line2',
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
94 \ '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
95
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 " 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
97 let l = split(execute('Xlist', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 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
99 \ ' 4 Xtestfile2:2 col 2: Line2',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 \ ' 6 Xtestfile3:3 col 1: Line3'], l)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102 " 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
103 let l = split(execute('Xlist!', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 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
105 \ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106 \ ' 5: non-error 3', ' 6 Xtestfile3:3 col 1: Line3'], l)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
107
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 " 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
109 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
110 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
111 \ ' 6 Xtestfile3:3 col 1: Line3'], l)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112
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! 3,4', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
114 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
115
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
116 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
117 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
118
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! -5,-3', ''), "\n")
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 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
121 \ ' 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
122
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
123 " 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
124 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
125 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
126 \ ' 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
127
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
128 " 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
129 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
130 \ {'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
131 \ {'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
132 \ {'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
133 \ {'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
134 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
135 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
136 \ ' 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
137 \ ' 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
138 \ ' 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
139 \ ' 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
140
13821
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
141 " 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
142 call g:Xsetlist([
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
143 \ {'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
144 \ {'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
145 \ {'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
146 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
147 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
148 \ ' 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
149 \ ' 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
150
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
151 " Error cases
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
152 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
153 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
155 func Test_clist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 call XlistTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157 call XlistTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
158 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
159
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
160 " 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
161 " 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
162 " already set by the caller.
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
163 func XageTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
164 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
165
12692
03a6aeea2096 patch 8.0.1224: still interference between test functions
Christian Brabandt <cb@256bit.org>
parents: 12465
diff changeset
166 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
167 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
168
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
169 " 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
170 silent! Xolder 99
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
171 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
172
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
173 silent! Xnewer 99
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
174 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
175
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
176 " Add three quickfix/location lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
177 Xgetexpr ['Xtestfile1:1:3:Line1']
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
178 Xgetexpr ['Xtestfile2:2:2:Line2']
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
179 Xgetexpr ['Xtestfile3:3:1:Line3']
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
180
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
181 " Go back two lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
182 Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
183 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
184 call assert_equal('Line2', l[0].text)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
185
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
186 " Go forward two lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
187 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
188 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
189 call assert_equal('Line3', l[0].text)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
190
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
191 " 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
192 Xolder 2
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
193 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
194 call assert_equal('Line1', l[0].text)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
195
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
196 Xnewer 2
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
197 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
198 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
199 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
200
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
201 func Test_cage()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
202 call XageTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
203 call XageTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
204 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
205
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
206 " 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
207 " commands
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
208 func XwindowTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
209 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
210
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
211 " 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
212 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
213 call assert_fails('lopen', 'E776:')
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
214 endif
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
215
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
216 " 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
217 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
218
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
219 " 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
220 Xwindow
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
221 call assert_true(winnr('$') == 1)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
222
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
223 " 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
224 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
225 \ 'Xtestfile3:3:1:Line3']
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
226
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
227 " Open the window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
228 Xwindow
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
229 call assert_true(winnr('$') == 2 && winnr() == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
230 \ 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
231 redraw!
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
232
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
233 " Close the window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
234 Xclose
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
235 call assert_true(winnr('$') == 1)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
236
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
237 " 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
238 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
239
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
240 " Open the window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
241 Xopen 5
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
242 call assert_true(winnr('$') == 2 && getline('.') ==# '|| non-error 1'
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
243 \ && winheight('.') == 5)
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
244
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
245 " 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
246 wincmd t
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
247 Xopen 7
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
248 call assert_true(winnr('$') == 2 && winnr() == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
249 \ winheight('.') == 7 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
250 \ getline('.') ==# '|| non-error 1')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
251
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
252
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
253 " 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
254 Xwindow
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
255 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
256
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
257 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
258 " 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
259 " quickfix buffer
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
260 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
261 \ '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
262 Xopen
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
263 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
264 tabnew
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
265 Xopen
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
266 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
267 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
268 endif
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
269 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
270
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
271 func Test_cwindow()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
272 call XwindowTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
273 call XwindowTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
274 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
275
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
276 " 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
277 " commands.
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
278 func XfileTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
279 call s:setup_commands(a:cchar)
7502
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 call writefile(['Xtestfile1:700:10:Line 700',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
282 \ 'Xtestfile2:800:15:Line 800'], 'Xqftestfile1')
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 enew!
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
285 Xfile Xqftestfile1
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
286 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
287 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
288 \ 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
289 \ 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
290
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
291 " Test with a non existent file
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
292 call assert_fails('Xfile non_existent_file', 'E40')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
293
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
294 " Run cfile/lfile from a modified buffer
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
295 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
296 silent! put ='Quickfix'
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
297 silent! Xfile Xqftestfile1
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
298 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
299
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
300 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
301 Xaddfile Xqftestfile1
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
302 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
303 call assert_true(len(l) == 3 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
304 \ 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
305
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
306 call writefile(['Xtestfile1:222:77:Line 222',
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
307 \ 'Xtestfile2:333:88:Line 333'], 'Xqftestfile1')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
308
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
309 enew!
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
310 Xgetfile Xqftestfile1
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
311 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
312 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
313 \ 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
314 \ 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
315
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
316 call delete('Xqftestfile1')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
317 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
318
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
319 func Test_cfile()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
320 call XfileTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
321 call XfileTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
322 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
323
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
324 " 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
325 " :lgetbuffer commands.
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
326 func XbufferTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
327 call s:setup_commands(a:cchar)
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
328
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
329 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
330 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
331 \ 'Xtestfile8:800:15:Line 800'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
332 Xbuffer!
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
333 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
334 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
335 \ 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
336 \ 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
337
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
338 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
339 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
340 \ 'Xtestfile10:950:66:Line 950'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
341 Xgetbuffer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
342 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
343 call assert_true(len(l) == 2 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
344 \ 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
345 \ 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
346
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
347 enew!
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
348 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
349 \ 'Xtestfile12:750:25:Line 750'])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
350 Xaddbuffer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
351 let l = g:Xgetlist()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
352 call assert_true(len(l) == 4 &&
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
353 \ 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
354 \ 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
355 \ 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
356 enew!
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
357
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
358 " 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
359 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
360
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
361 " 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
362 edit Xtestfile1
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
363 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
364 enew!
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
365 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
366
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
367 " 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
368 " 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
369 " 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
370 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
371 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
372 else
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
373 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
374 endif
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
375 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
376
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
377 func Test_cbuffer()
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
378 call XbufferTests('c')
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
379 call XbufferTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
380 endfunc
7502
3e306ae760d0 commit https://github.com/vim/vim/commit/da59dd5da6440c3410866ed61ce169a2012ba5bd
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
381
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
382 func XexprTests(cchar)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
383 call s:setup_commands(a:cchar)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
384
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
385 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
386 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
387
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
388 func Test_cexpr()
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
389 call XexprTests('c')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
390 call XexprTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
391 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
392
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
393 " 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
394 func Xtest_browse(cchar)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
395 call s:setup_commands(a:cchar)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
396
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
397 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
398 " 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
399 " result in failure
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
400 if a:cchar == 'c'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
401 let err = 'E42:'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
402 else
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
403 let err = 'E776:'
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
404 endif
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
405 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
406 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
407 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
408 call assert_fails('Xpfile', err)
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
409
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
410 call s:create_test_file('Xqftestfile1')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
411 call s:create_test_file('Xqftestfile2')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
412
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
413 Xgetexpr ['Xqftestfile1:5:Line5',
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
414 \ 'Xqftestfile1:6:Line6',
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
415 \ '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
416 \ 'Xqftestfile2:11:Line11',
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
417 \ 'RegularLine1',
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
418 \ 'RegularLine2']
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
419
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
420 Xfirst
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
421 call assert_fails('Xprev', 'E553')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
422 call assert_fails('Xpfile', 'E553')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
423 Xnfile
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
424 call assert_equal('Xqftestfile2', bufname('%'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
425 call assert_equal(10, line('.'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
426 Xpfile
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
427 call assert_equal('Xqftestfile1', bufname('%'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
428 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
429 5Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
430 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
431 2Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
432 call assert_equal(2, 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
433 10Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
434 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
435 Xlast
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
436 Xprev
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
437 call assert_equal('Xqftestfile2', bufname('%'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
438 call assert_equal(11, line('.'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
439 call assert_fails('Xnext', 'E553')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
440 call assert_fails('Xnfile', 'E553')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
441 Xrewind
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
442 call assert_equal('Xqftestfile1', bufname('%'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
443 call assert_equal(5, line('.'))
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
444
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
445 10Xnext
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
446 call assert_equal('Xqftestfile2', bufname('%'))
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
447 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
448 10Xprev
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
449 call assert_equal('Xqftestfile1', bufname('%'))
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
450 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
451
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
452 " 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
453 Xgetexpr ['Xqftestfile1:5:Line5',
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
454 \ 'Xqftestfile1:6:Line6',
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
455 \ 'Xqftestfile2:10:Line10',
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
456 \ 'Xqftestfile2:11:Line11']
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
457 Xopen
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
458 10Xcc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
459 call assert_equal(11, line('.'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
460 call assert_equal('Xqftestfile2', bufname('%'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
461
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
462 " 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
463 " present)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
464 Xopen | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
465 Xlast 1
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
466 call assert_equal(5, line('.'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
467 call assert_equal('Xqftestfile1', bufname('%'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
468
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
469 Xexpr ""
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
470 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
471
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
472 call delete('Xqftestfile1')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
473 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
474
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
475 " 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
476 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
477 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
478 call assert_equal(0, 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
479 Xaddexpr ['foo', 'bar', 'baz', 'quux', 'shmoo']
805f7fd40e0d patch 8.0.1112: can't get size or current index from quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12427
diff changeset
480 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
481 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
482 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
483 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
484 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
485 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
486 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
487 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
488
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
489 func Test_browse()
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
490 call Xtest_browse('c')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
491 call Xtest_browse('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
492 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
493
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
494 func Test_nomem()
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
495 call test_alloc_fail(GetAllocId('qf_dirname_start'), 0, 0)
7593
87e607fb6853 commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents: 7545
diff changeset
496 call assert_fails('vimgrep vim runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
497
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
498 call test_alloc_fail(GetAllocId('qf_dirname_now'), 0, 0)
7593
87e607fb6853 commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents: 7545
diff changeset
499 call assert_fails('vimgrep vim runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
500
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
501 call test_alloc_fail(GetAllocId('qf_namebuf'), 0, 0)
7593
87e607fb6853 commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents: 7545
diff changeset
502 call assert_fails('cfile runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
503
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
504 call test_alloc_fail(GetAllocId('qf_errmsg'), 0, 0)
7593
87e607fb6853 commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents: 7545
diff changeset
505 call assert_fails('cfile runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
506
9121
7350959e53c3 commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents: 9114
diff changeset
507 call test_alloc_fail(GetAllocId('qf_pattern'), 0, 0)
7593
87e607fb6853 commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae
Christian Brabandt <cb@256bit.org>
parents: 7545
diff changeset
508 call assert_fails('cfile runtest.vim', 'E342:')
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
509
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
510 endfunc
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
511
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
512 func s:test_xhelpgrep(cchar)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
513 call s:setup_commands(a:cchar)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
514 Xhelpgrep quickfix
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
515 Xopen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
516 if a:cchar == 'c'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
517 let title_text = ':helpgrep quickfix'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
518 else
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
519 let title_text = ':lhelpgrep quickfix'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
520 endif
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
521 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
522
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
523 " 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
524 only
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
525 Xnext
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
526 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
527 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
528 " 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
529 Xnext
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
530 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
531 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
532 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
533 " 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
534 " window
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
535 Xopen
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
536 Xnext
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
537 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
538 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
539 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
540
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
541 " 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
542 Xclose
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
543
12427
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
544 if a:cchar == 'l'
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
545 " 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
546 " 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
547 new | only
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
548 call g:Xsetlist([], 'f')
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
549 help index.txt
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
550 wincmd w
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
551 lhelpgrep quickfix
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
552 call assert_equal(1, winnr())
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
553 call assert_notequal([], getloclist(1))
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
554 call assert_equal([], getloclist(2))
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
555 endif
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
556
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
557 new | only
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
558
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
559 " 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
560 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
561 " Invalid regular expression
f508bb2fb808 patch 8.1.0469: too often indexing in qf_lists[]
Bram Moolenaar <Bram@vim.org>
parents: 14664
diff changeset
562 call assert_fails('Xhelpgrep \@<!', 'E480:')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
563 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
564
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
565 func Test_helpgrep()
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
566 call s:test_xhelpgrep('c')
9752
429be545637a commit https://github.com/vim/vim/commit/cf25fdb8f10a92b3bf9e295c466c1b69812b7886
Christian Brabandt <cb@256bit.org>
parents: 9608
diff changeset
567 helpclose
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
568 call s:test_xhelpgrep('l')
7677
85a7a945fb87 commit https://github.com/vim/vim/commit/62ef797496c6243d111c596a592a8ef8c1d1e710
Christian Brabandt <cb@256bit.org>
parents: 7593
diff changeset
569 endfunc
7513
37e061ec063c commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Christian Brabandt <cb@256bit.org>
parents: 7502
diff changeset
570
7710
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
571 func Test_errortitle()
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
572 augroup QfBufWinEnter
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
573 au!
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
574 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
575 augroup END
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
576 copen
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
577 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
578 call setqflist(a)
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
579 call assert_equal(':setqflist()', g:a)
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
580 augroup QfBufWinEnter
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
581 au!
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
582 augroup END
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
583 augroup! QfBufWinEnter
bf58e9f8d52a commit https://github.com/vim/vim/commit/6920c72d4d62c8dc5596e9f392e38204f561d7af
Christian Brabandt <cb@256bit.org>
parents: 7677
diff changeset
584 endfunc
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
585
8603
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
586 func Test_vimgreptitle()
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
587 augroup QfBufWinEnter
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
588 au!
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
589 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
590 augroup END
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
591 try
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
592 vimgrep /pattern/j file
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
593 catch /E480/
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
594 endtry
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
595 copen
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
596 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
597 augroup QfBufWinEnter
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
598 au!
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
599 augroup END
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
600 augroup! QfBufWinEnter
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
601 endfunc
bfa74b84c41c commit https://github.com/vim/vim/commit/5584df65a0ca2315d1eebc13c54a448bee4d0758
Christian Brabandt <cb@256bit.org>
parents: 8597
diff changeset
602
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
603 func XqfTitleTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
604 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
605
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
606 Xgetexpr ['file:1:1:message']
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
607 let l = g:Xgetlist()
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
608 if a:cchar == 'c'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
609 call setqflist(l, 'r')
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
610 else
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
611 call setloclist(0, l, 'r')
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
612 endif
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
613
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
614 Xopen
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
615 if a:cchar == 'c'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
616 let title = ':setqflist()'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
617 else
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
618 let title = ':setloclist()'
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
619 endif
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
620 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
621 Xclose
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
622 endfunc
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
623
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
624 " 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
625 func Test_qf_title()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
626 call XqfTitleTests('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
627 call XqfTitleTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
628 endfunc
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
629
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
630 " Tests for 'errorformat'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
631 func Test_efm()
8558
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
632 let save_efm = &efm
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
633 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
634 cgetexpr ['WWWW', 'EEEE', 'CCCC']
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
635 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
636 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
637 cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC']
22aecf80378e commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Christian Brabandt <cb@256bit.org>
parents: 7710
diff changeset
638 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
639 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
640 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
641 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
642 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
643 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
644 endfunc
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
645
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
646 " 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
647 " 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
648 " 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
649 " 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
650 " instead creating new windows.
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
651 " 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
652 " window it belongs to.
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
653 "
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
654 " Set up the test environment:
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
655 func ReadTestProtocol(name)
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
656 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
657 let word = substitute(base, '\v(.*)\..*', '\1', '')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
658
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
659 setl modifiable
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
660 setl noreadonly
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
661 setl noswapfile
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
662 setl bufhidden=delete
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
663 %del _
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
664 " For problem 2:
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
665 " '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
666 setl buftype=nofile
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
667
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
668 call setline(1, word)
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
669
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
670 setl nomodified
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
671 setl nomodifiable
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
672 setl readonly
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
673 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
674 endfunc
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
675
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
676 func Test_locationlist()
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
677 enew
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
678
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
679 augroup testgroup
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
680 au!
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
681 autocmd BufReadCmd test://* call ReadTestProtocol(expand("<amatch>"))
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
682 augroup END
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
683
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
684 let words = [ "foo", "bar", "baz", "quux", "shmoo", "spam", "eggs" ]
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
685
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
686 let qflist = []
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
687 for word in words
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
688 call add(qflist, {'filename': 'test://' . word . '.txt', 'text': 'file ' . word . '.txt', })
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
689 " NOTE: problem 1:
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
690 " intentionally not setting 'lnum' so that the quickfix entries are not
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
691 " valid
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
692 call setloclist(0, qflist, ' ')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
693 endfor
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
694
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
695 " Test A
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
696 lrewind
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
697 enew
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
698 lopen
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
699 4lnext
8597
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
700 vert split
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
701 wincmd L
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
702 lopen
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
703 wincmd p
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
704 lnext
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
705 let fileName = expand("%")
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
706 wincmd p
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
707 let locationListFileName = substitute(getline(line('.')), '\([^|]*\)|.*', '\1', '')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
708 let fileName = substitute(fileName, '\\', '/', 'g')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
709 let locationListFileName = substitute(locationListFileName, '\\', '/', 'g')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
710 call assert_equal("test://bar.txt", fileName)
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
711 call assert_equal("test://bar.txt", locationListFileName)
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
712
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
713 wincmd n | only
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
714
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
715 " Test B:
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
716 lrewind
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
717 lopen
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
718 2
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
719 exe "normal \<CR>"
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
720 wincmd p
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
721 3
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
722 exe "normal \<CR>"
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
723 wincmd p
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
724 4
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
725 exe "normal \<CR>"
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
726 call assert_equal(2, winnr('$'))
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
727 wincmd n | only
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
728
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
729 " Test C:
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
730 lrewind
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
731 lopen
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
732 " Let's move the location list window to the top to check whether it (the
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
733 " first window found) will be reused when we try to open new windows:
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
734 wincmd K
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
735 2
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
736 exe "normal \<CR>"
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
737 wincmd p
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
738 3
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
739 exe "normal \<CR>"
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
740 wincmd p
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
741 4
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
742 exe "normal \<CR>"
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
743 1wincmd w
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
744 call assert_equal('quickfix', &buftype)
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
745 2wincmd w
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
746 let bufferName = expand("%")
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
747 let bufferName = substitute(bufferName, '\\', '/', 'g')
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
748 call assert_equal('test://quux.txt', bufferName)
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
749
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
750 wincmd n | only
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
751
51de88bf954d commit https://github.com/vim/vim/commit/1ff2b64b11e7d263c6853745d5e594bd8f94b91e
Christian Brabandt <cb@256bit.org>
parents: 8558
diff changeset
752 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
753 endfunc
8605
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
754
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
755 func Test_locationlist_curwin_was_closed()
8605
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
756 augroup testgroup
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
757 au!
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
758 autocmd BufReadCmd test_curwin.txt call R(expand("<amatch>"))
8605
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
759 augroup END
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
760
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
761 func! R(n)
8605
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
762 quit
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
763 endfunc
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
764
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
765 new
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
766 let q = []
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
767 call add(q, {'filename': 'test_curwin.txt' })
8605
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
768 call setloclist(0, q)
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
769 call assert_fails('lrewind', 'E924:')
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
770
536b9b88d1ca commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Christian Brabandt <cb@256bit.org>
parents: 8603
diff changeset
771 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
772 endfunc
8649
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
773
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
774 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
775 call writefile(['loclistfoo'], 'loclistfoo')
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
776 call writefile(['loclistbar'], 'loclistbar')
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
777 set switchbuf=usetab
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
778
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
779 edit loclistfoo
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
780 tabedit loclistbar
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
781 silent lgrep loclistfoo loclist*
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
782 call assert_equal(1, tabpagenr())
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
783
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
784 enew | only | tabonly
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
785 set switchbuf&vim
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
786 call delete('loclistfoo')
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
787 call delete('loclistbar')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
788 endfunc
10281
92fa8e5ef210 commit https://github.com/vim/vim/commit/0a9046fbcb33770517ab0220b8100c4494bddab2
Christian Brabandt <cb@256bit.org>
parents: 10257
diff changeset
789
8649
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
790 " More tests for 'errorformat'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
791 func Test_efm1()
8649
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
792 if !has('unix')
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
793 " The 'errorformat' setting is different on non-Unix systems.
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
794 " This test works only on Unix-like systems.
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
795 return
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
796 endif
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
797
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
798 let l = [
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
799 \ '"Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
800 \ '"Xtestfile", line 6 col 19; this is an error',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
801 \ 'gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
802 \ 'Xtestfile:9: parse error before `asd''',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
803 \ 'make: *** [vim] Error 1',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
804 \ 'in file "Xtestfile" linenr 10: there is an error',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
805 \ '',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
806 \ '2 returned',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
807 \ '"Xtestfile", line 11 col 1; this is an error',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
808 \ '"Xtestfile", line 12 col 2; this is another error',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
809 \ '"Xtestfile", line 14:10; this is an error in column 10',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
810 \ '=Xtestfile=, line 15:10; this is another error, but in vcol 10 this time',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
811 \ '"Xtestfile", linenr 16: yet another problem',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
812 \ 'Error in "Xtestfile" at line 17:',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
813 \ 'x should be a dot',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
814 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
815 \ ' ^',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
816 \ 'Error in "Xtestfile" at line 18:',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
817 \ 'x should be a dot',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
818 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
819 \ '.............^',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
820 \ 'Error in "Xtestfile" at line 19:',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
821 \ 'x should be a dot',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
822 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
823 \ '--------------^',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
824 \ 'Error in "Xtestfile" at line 20:',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
825 \ 'x should be a dot',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
826 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
827 \ ' ^',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
828 \ '',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
829 \ 'Does anyone know what is the problem and how to correction it?',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
830 \ '"Xtestfile", line 21 col 9: What is the title of the quickfix window?',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
831 \ '"Xtestfile", line 22 col 9: What is the title of the quickfix window?'
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
832 \ ]
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
833
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
834 call writefile(l, 'Xerrorfile1')
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
835 call writefile(l[:-2], 'Xerrorfile2')
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
836
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
837 let m = [
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
838 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
839 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
840 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
841 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
842 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
843 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
844 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
845 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
846 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
847 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
848 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
849 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
850 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
851 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
852 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
853 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
854 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
855 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
856 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
857 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21',
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
858 \ ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22'
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
859 \ ]
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
860 call writefile(m, 'Xtestfile')
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
861
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
862 let save_efm = &efm
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
863 set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
864 set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
865
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
866 exe 'cf Xerrorfile2'
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
867 clast
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
868 copen
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
869 call assert_equal(':cf Xerrorfile2', w:quickfix_title)
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
870 wincmd p
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
871
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
872 exe 'cf Xerrorfile1'
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
873 call assert_equal([4, 12], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
874 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
875 call assert_equal([6, 19], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
876 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
877 call assert_equal([9, 2], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
878 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
879 call assert_equal([10, 2], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
880 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
881 call assert_equal([11, 1], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
882 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
883 call assert_equal([12, 2], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
884 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
885 call assert_equal([14, 10], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
886 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
887 call assert_equal([15, 3, 10], [line('.'), col('.'), virtcol('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
888 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
889 call assert_equal([16, 2], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
890 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
891 call assert_equal([17, 6], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
892 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
893 call assert_equal([18, 7], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
894 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
895 call assert_equal([19, 8], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
896 cn
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
897 call assert_equal([20, 9], [line('.'), col('.')])
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
898 clast
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
899 cprev
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
900 cprev
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
901 wincmd w
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
902 call assert_equal(':cf Xerrorfile1', w:quickfix_title)
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
903 wincmd p
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
904
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
905 let &efm = save_efm
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
906 call delete('Xerrorfile1')
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
907 call delete('Xerrorfile2')
ec78ecf15de7 commit https://github.com/vim/vim/commit/7eba3d2cbf19e731dc51652bc26099cc253d538a
Christian Brabandt <cb@256bit.org>
parents: 8605
diff changeset
908 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
909 endfunc
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
910
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
911 " 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
912 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
913 call s:setup_commands(a:cchar)
674f9e3ccd1a commit https://github.com/vim/vim/commit/38df43bd13a2498cc96b3ddd9a20dd75126bd171
Christian Brabandt <cb@256bit.org>
parents: 9317
diff changeset
914
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
915 let save_efm=&efm
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
916 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
917
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
918 let lines = ["Entering dir 'dir1/a'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
919 \ 'habits2.txt:1:Nine Healthy Habits',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
920 \ "Entering dir 'b'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
921 \ '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
922 \ 'habits2.txt:7:5 Small meals',
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
923 \ "Entering dir 'dir1/c'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
924 \ '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
925 \ "Leaving dir 'dir1/c'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
926 \ "Leaving dir 'dir1/a'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
927 \ '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
928 \ "Entering dir 'dir2'",
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
929 \ '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
930 \ "Leaving dir 'dir2'"
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
931 \]
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
932
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
933 Xexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
934 for l in lines
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
935 Xaddexpr l
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
936 endfor
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
937
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
938 let qf = g:Xgetlist()
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
939
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
940 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
941 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
942 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
943 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
944 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
945 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
946 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
947 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
948 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
949 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
950 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
951 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
952
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
953 let &efm=save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
954 endfunc
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
955
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
956 " 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
957 func Test_efm_dirstack()
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
958 " Create the directory stack and files
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
959 call mkdir('dir1')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
960 call mkdir('dir1/a')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
961 call mkdir('dir1/a/b')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
962 call mkdir('dir1/c')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
963 call mkdir('dir2')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
964
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
965 let lines = ["Nine Healthy Habits",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
966 \ "0 Hours of television",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
967 \ "1 Hour of exercise",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
968 \ "2 Liters of water",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
969 \ "3 Cups of hot green tea",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
970 \ "4 Short mental breaks",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
971 \ "5 Small meals",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
972 \ "6 AM wake up time",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
973 \ "7 Minutes of laughter",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
974 \ "8 Hours of sleep (at least)",
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
975 \ "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
976 \ ]
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
977 call writefile(lines, 'habits1.txt')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
978 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
979 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
980 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
981 call writefile(lines, 'dir2/habits5.txt')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
982
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
983 call s:dir_stack_tests('c')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
984 call s:dir_stack_tests('l')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
985
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
986 call delete('dir1', 'rf')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
987 call delete('dir2', 'rf')
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
988 call delete('habits1.txt')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
989 endfunc
9309
178252c6850e commit https://github.com/vim/vim/commit/ab47c61f46f0797308217cd3c045472cb0ec3195
Christian Brabandt <cb@256bit.org>
parents: 9258
diff changeset
990
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
991 " 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
992 func Xefm_ignore_continuations(cchar)
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
993 call s:setup_commands(a:cchar)
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
994
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
995 let save_efm = &efm
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
996
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
997 let &efm =
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
998 \ '%Eerror %m %l,' .
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
999 \ '%-Wignored %m %l,' .
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1000 \ '%+Cmore ignored %m %l,' .
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1001 \ '%Zignored end'
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1002 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
1003 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
1004 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
1005
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1006 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1007 endfunc
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1008
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1009 func Test_efm_ignore_continuations()
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1010 call Xefm_ignore_continuations('c')
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1011 call Xefm_ignore_continuations('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1012 endfunc
10257
2d0e6034743a commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49
Christian Brabandt <cb@256bit.org>
parents: 10237
diff changeset
1013
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1014 " 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
1015 func Xinvalid_efm_Tests(cchar)
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1016 call s:setup_commands(a:cchar)
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1017
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1018 let save_efm = &efm
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1019
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1020 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
1021 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
1022
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1023 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
1024 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
1025
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1026 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
1027 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
1028
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1029 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
1030 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
1031
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1032 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
1033 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
1034
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1035 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
1036 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
1037
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1038 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
1039 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
1040
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1041 set efm=
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1042 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
1043
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1044 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
1045 call assert_fails('Xexpr ["Entering dir abc", "abc.txt:1:Hello world"]', 'E379:')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1046
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1047 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1048 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1049
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1050 func Test_invalid_efm()
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1051 call Xinvalid_efm_Tests('c')
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1052 call Xinvalid_efm_Tests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1053 endfunc
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1054
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1055 " TODO:
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1056 " 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
1057 " %r %O
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1058 func Test_efm2()
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1059 let save_efm = &efm
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1060
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1061 " Test for %s format in efm
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1062 set efm=%f:%s
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1063 cexpr 'Xtestfile:Line search text'
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1064 let l = getqflist()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1065 call assert_equal(l[0].pattern, '^\VLine search text\$')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1066 call assert_equal(l[0].lnum, 0)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1067
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1068 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
1069 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
1070
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1071 " Test for %P, %Q and %t format specifiers
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1072 let lines=["[Xtestfile1]",
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1073 \ "(1,17) error: ';' missing",
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1074 \ "(21,2) warning: variable 'z' not defined",
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1075 \ "(67,3) error: end of file found before string ended",
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1076 \ "--",
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1077 \ "",
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1078 \ "[Xtestfile2]",
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1079 \ "--",
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1080 \ "",
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1081 \ "[Xtestfile3]",
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1082 \ "NEW compiler v1.1",
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1083 \ "(2,2) warning: variable 'x' not defined",
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1084 \ "(67,3) warning: 's' already defined",
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1085 \ "--"
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1086 \]
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1087 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
1088 " 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
1089 " need to be created.
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1090 call writefile(['Line1'], 'Xtestfile1')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1091 call writefile(['Line2'], 'Xtestfile2')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1092 call writefile(['Line3'], 'Xtestfile3')
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1093 cexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1094 for l in lines
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1095 caddexpr l
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1096 endfor
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1097 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
1098 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
1099 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
1100 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
1101 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
1102 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
1103 call delete('Xtestfile1')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1104 call delete('Xtestfile2')
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1105 call delete('Xtestfile3')
9405
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1106
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1107 " Tests for %E, %C and %Z format specifiers
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1108 let lines = ["Error 275",
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1109 \ "line 42",
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1110 \ "column 3",
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1111 \ "' ' expected after '--'"
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1112 \]
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1113 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
1114 cgetexpr lines
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1115 let l = getqflist()
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1116 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
1117 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
1118 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
1119 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
1120 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
1121
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1122 " Test for %>
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1123 let lines = ["Error in line 147 of foo.c:",
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1124 \"unknown variable 'i'"
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1125 \]
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1126 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
1127 cgetexpr lines
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1128 let l = getqflist()
2ce9814053d8 commit https://github.com/vim/vim/commit/0fcc7c6dd1902b71e0e7d0a35ddabafef6455a83
Christian Brabandt <cb@256bit.org>
parents: 9397
diff changeset
1129 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
1130 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
1131 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
1132
9568
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1133 " Test for %A, %C and other formats
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1134 let lines = [
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1135 \"==============================================================",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1136 \"FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest)",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1137 \"--------------------------------------------------------------",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1138 \"Traceback (most recent call last):",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1139 \' File "unittests/dbfacadeTest.py", line 89, in testFoo',
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1140 \" self.assertEquals(34, dtid)",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1141 \' File "/usr/lib/python2.2/unittest.py", line 286, in',
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1142 \" failUnlessEqual",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1143 \" raise self.failureException, \\",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1144 \"AssertionError: 34 != 33",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1145 \"",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1146 \"--------------------------------------------------------------",
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1147 \"Ran 27 tests in 0.063s"
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1148 \]
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1149 set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1150 cgetexpr lines
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1151 let l = getqflist()
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1152 call assert_equal(8, len(l))
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1153 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
1154 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
1155 call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr))
ccbd2e604e59 commit https://github.com/vim/vim/commit/e87e6dddc2b2a99572ec0db0833c052214c4fbd3
Christian Brabandt <cb@256bit.org>
parents: 9540
diff changeset
1156
13821
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1157 " Test for %o
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1158 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
1159 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
1160 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
1161 let l = getqflist()
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1162 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
1163 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
1164 copen
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1165 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
1166 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
1167 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
1168 cclose
98274127d675 patch 8.0.1782: no simple way to label quickfix entries
Christian Brabandt <cb@256bit.org>
parents: 13819
diff changeset
1169 bd
13825
eb7707562201 patch 8.0.1784: gvim test gets stuck in dialog
Christian Brabandt <cb@256bit.org>
parents: 13821
diff changeset
1170 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
1171
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1172 " 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
1173 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
1174 cgetexpr ['msg1']
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1175 let l = getqflist()
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1176 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
1177 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
1178 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
1179 lexpr 'msg2'
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1180 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
1181 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
1182 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
1183 lopen
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1184 call setqflist([], 'r')
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1185 caddbuf
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1186 let l = getqflist()
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1187 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
1188 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
1189
13948
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1190 " 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
1191 set noignorecase
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1192 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
1193 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
1194 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
1195 set ignorecase&
2ed1585c6467 patch 8.0.1844: superfluous quickfix code, missing examples
Christian Brabandt <cb@256bit.org>
parents: 13921
diff changeset
1196
11378
2ed7a34ecc54 patch 8.0.0574: get only one quickfix list after :caddbuf
Christian Brabandt <cb@256bit.org>
parents: 11301
diff changeset
1197 new | only
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1198 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1199 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1200
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1201 func XquickfixChangedByAutocmd(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1202 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
1203 if a:cchar == 'c'
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1204 let ErrorNr = 'E925'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1205 func! ReadFunc()
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1206 colder
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1207 cgetexpr []
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1208 endfunc
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1209 else
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1210 let ErrorNr = 'E926'
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1211 func! ReadFunc()
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1212 lolder
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1213 lgetexpr []
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1214 endfunc
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1215 endif
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1216
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1217 augroup testgroup
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1218 au!
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1219 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
1220 augroup END
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1221
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1222 new | only
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1223 let words = [ "a", "b" ]
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1224 let qflist = []
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1225 for word in words
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1226 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
1227 call g:Xsetlist(qflist, ' ')
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1228 endfor
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1229 call assert_fails('Xrewind', ErrorNr . ':')
8702
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1230
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1231 augroup! testgroup
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1232 endfunc
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1233
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1234 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
1235 call XquickfixChangedByAutocmd('c')
39d6e4f2f748 commit https://github.com/vim/vim/commit/ffec3c53496d49668669deabc0724ec78e2274fd
Christian Brabandt <cb@256bit.org>
parents: 8649
diff changeset
1236 call XquickfixChangedByAutocmd('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1237 endfunc
8716
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1238
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1239 func Test_caddbuffer_to_empty()
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1240 helpgr quickfix
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1241 call setqflist([], 'r')
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1242 cad
8722
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1243 try
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1244 cn
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1245 catch
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1246 " number of matches is unknown
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1247 call assert_true(v:exception =~ 'E553:')
ecb57048c2a8 commit https://github.com/vim/vim/commit/f68f1d70799631d38461c36cd59d08cf839b010d
Christian Brabandt <cb@256bit.org>
parents: 8716
diff changeset
1248 endtry
8716
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1249 quit!
4ce26276caeb commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071
Christian Brabandt <cb@256bit.org>
parents: 8702
diff changeset
1250 endfunc
8751
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1251
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1252 func Test_cgetexpr_works()
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1253 " this must not crash Vim
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1254 cgetexpr [$x]
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1255 lgetexpr [$x]
8751
7f974075eb8f commit https://github.com/vim/vim/commit/89c64d557dbe0bacfdd7b2872411b00cc1523d85
Christian Brabandt <cb@256bit.org>
parents: 8722
diff changeset
1256 endfunc
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1257
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1258 " 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
1259 func SetXlistTests(cchar, bnum)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1260 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
1261
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1262 call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 1},
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1263 \ {'bufnr': a:bnum, 'lnum': 2}])
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1264 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1265 call assert_equal(2, len(l))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1266 call assert_equal(2, l[1].lnum)
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1267
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1268 Xnext
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1269 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
1270 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1271 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
1272 Xnext
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1273 call assert_equal(3, line('.'))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1274
9114
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1275 " 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
1276 " in the quickfix window
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1277 Xwindow
9114
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1278 1
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1279 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
1280 \ {'bufnr': a:bnum, 'lnum': 5}], 'a')
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1281 call assert_equal(1, line('.'))
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1282 close
f221aec7fcca commit https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Christian Brabandt <cb@256bit.org>
parents: 9033
diff changeset
1283
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1284 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
1285 \ {'bufnr': a:bnum, 'lnum': 4},
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1286 \ {'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
1287 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1288 call assert_equal(3, len(l))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1289 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
1290
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1291 call g:Xsetlist([])
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1292 let l = g:Xgetlist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1293 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
1294
11390
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1295 " 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
1296 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
1297 Xwindow
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1298 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
1299 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
1300 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
1301 call assert_equal(0, 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
1302 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
1303 Xwindow
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1304 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
1305 Xclose
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1306 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
1307 set efm=%m
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1308 Xgetexpr 'TestMessage'
73cfcf11d983 patch 8.0.0580: cannot set the valid flag with setqflist()
Christian Brabandt <cb@256bit.org>
parents: 11388
diff changeset
1309 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
1310 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
1311 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
1312 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
1313
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1314 " Error cases:
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1315 " 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
1316 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
1317 \ " {'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
1318 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
1319 call assert_equal(0, len(g:Xgetlist()))
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1320 endfunc
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1321
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1322 func Test_setqflist()
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1323 new Xtestfile | only
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1324 let bnum = bufnr('%')
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1325 call setline(1, range(1,5))
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1326
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1327 call SetXlistTests('c', bnum)
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1328 call SetXlistTests('l', bnum)
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1329
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1330 enew!
8932
25c2031e9f9f commit https://github.com/vim/vim/commit/c1808d5822ed9534ef7f0fe509b15bee92a5cc28
Christian Brabandt <cb@256bit.org>
parents: 8751
diff changeset
1331 call delete('Xtestfile')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1332 endfunc
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1333
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1334 func Xlist_empty_middle(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1335 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1336
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1337 " 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
1338 let @/ = 'Test_'
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1339 Xvimgrep // test_quickfix.vim
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1340 let testlen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1341 call assert_true(testlen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1342 Xvimgrep empty test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1343 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
1344 Xvimgrep matches test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1345 let matchlen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1346 call assert_true(matchlen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1347 Xolder
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1348 " make the middle list empty
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1349 call g:Xsetlist([], 'r')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1350 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
1351 Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1352 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
1353 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1354 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1355 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
1356 endfunc
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1357
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1358 func Test_setqflist_empty_middle()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1359 call Xlist_empty_middle('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1360 call Xlist_empty_middle('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1361 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1362
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1363 func Xlist_empty_older(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1364 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1365
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1366 " create three quickfix lists
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1367 Xvimgrep one test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1368 let onelen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1369 call assert_true(onelen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1370 Xvimgrep two test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1371 let twolen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1372 call assert_true(twolen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1373 Xvimgrep three test_quickfix.vim
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1374 let threelen = len(g:Xgetlist())
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1375 call assert_true(threelen > 0)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1376 Xolder 2
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1377 " 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
1378 call g:Xsetlist([], 'r')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1379 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
1380 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1381 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
1382 Xnewer
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1383 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
1384 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1385
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1386 func Test_setqflist_empty_older()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1387 call Xlist_empty_older('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1388 call Xlist_empty_older('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1389 endfunc
9258
7e403edce82f commit https://github.com/vim/vim/commit/1cee693b310e1494115a1677fac064941092e1bb
Christian Brabandt <cb@256bit.org>
parents: 9121
diff changeset
1390
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1391 func XquickfixSetListWithAct(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1392 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1393
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1394 let list1 = [{'filename': 'fnameA', 'text': 'A'},
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1395 \ {'filename': 'fnameB', 'text': 'B'}]
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1396 let list2 = [{'filename': 'fnameC', 'text': 'C'},
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1397 \ {'filename': 'fnameD', 'text': 'D'},
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1398 \ {'filename': 'fnameE', 'text': 'E'}]
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1399
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1400 " {action} is unspecified. Same as specifing ' '.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1401 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1402 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1403 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1404 call g:Xsetlist(list2)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1405 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1406 call assert_equal(3, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1407 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
1408 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
1409 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
1410 silent! Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1411 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1412 call assert_equal(2, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1413 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
1414 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
1415
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1416 " {action} is specified ' '.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1417 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1418 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1419 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1420 call g:Xsetlist(list2, ' ')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1421 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1422 call assert_equal(3, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1423 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
1424 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
1425 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
1426 silent! Xolder
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1427 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1428 call assert_equal(2, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1429 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
1430 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
1431
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1432 " {action} is specified 'a'.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1433 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1434 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1435 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1436 call g:Xsetlist(list2, 'a')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1437 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1438 call assert_equal(5, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1439 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
1440 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
1441 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
1442 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
1443 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
1444
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1445 " {action} is specified 'r'.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1446 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1447 silent! Xnewer 99
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1448 call g:Xsetlist(list1)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1449 call g:Xsetlist(list2, 'r')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1450 let li = g:Xgetlist()
8965
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1451 call assert_equal(3, len(li))
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1452 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
1453 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
1454 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
1455
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1456 " Test for wrong value.
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1457 new | only
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1458 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
1459 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
1460 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
1461 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
1462 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
1463 endfunc
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1464
13066
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1465 func Test_setqflist_invalid_nr()
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1466 " The following command used to crash Vim
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1467 call setqflist([], ' ', {'nr' : $XXX_DOES_NOT_EXIST})
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1468 endfunc
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
1469
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1470 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
1471 call XquickfixSetListWithAct('c')
90f7dc794aa0 commit https://github.com/vim/vim/commit/d106e5ba7f10f0d2a14eaefe5d78405044416cb9
Christian Brabandt <cb@256bit.org>
parents: 8932
diff changeset
1472 call XquickfixSetListWithAct('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1473 endfunc
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1474
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1475 func XLongLinesTests(cchar)
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1476 let l = g:Xgetlist()
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1477
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1478 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
1479 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
1480 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
1481 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
1482 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
1483 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
1484 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
1485 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
1486 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
1487 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
1488 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
1489 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
1490 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
1491
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1492 call g:Xsetlist([], 'r')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1493 endfunc
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1494
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1495 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
1496 call s:setup_commands(a:cchar)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1497
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1498 let testfile = 'samples/quickfix.txt'
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1499
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1500 " file
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1501 exe 'Xgetfile' testfile
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1502 call XLongLinesTests(a:cchar)
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1503
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1504 " list
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1505 Xexpr readfile(testfile)
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1506 call XLongLinesTests(a:cchar)
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1507
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1508 " string
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1509 Xexpr join(readfile(testfile), "\n")
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1510 call XLongLinesTests(a:cchar)
9033
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1511
0536d1469b67 commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Christian Brabandt <cb@256bit.org>
parents: 8965
diff changeset
1512 " buffer
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1513 exe 'edit' testfile
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1514 exe 'Xbuffer' bufnr('%')
9336
52bda0e40ea2 commit https://github.com/vim/vim/commit/f50df3925b7c909d1cda4c868d8c7ba38189aabe
Christian Brabandt <cb@256bit.org>
parents: 9334
diff changeset
1515 call XLongLinesTests(a:cchar)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1516 endfunc
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1517
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1518 func Test_long_lines()
9317
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1519 call s:long_lines_tests('c')
fa3f71185144 commit https://github.com/vim/vim/commit/3ef5bf7d459d6b8a21aaefc80f65448f5a7aa59f
Christian Brabandt <cb@256bit.org>
parents: 9309
diff changeset
1520 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
1521 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1522
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1523 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
1524 let l = []
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1525 for i in range(1, 20)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1526 call add(l, 'Line' . i)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1527 endfor
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1528 call writefile(l, a:filename)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1529 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1530
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1531 func Test_switchbuf()
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1532 call s:create_test_file('Xqftestfile1')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1533 call s:create_test_file('Xqftestfile2')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1534 call s:create_test_file('Xqftestfile3')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1535
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1536 new | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1537 edit Xqftestfile1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1538 let file1_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1539 new Xqftestfile2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1540 let file2_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1541 cgetexpr ['Xqftestfile1:5:Line5',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1542 \ 'Xqftestfile1:6:Line6',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1543 \ 'Xqftestfile2:10:Line10',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1544 \ 'Xqftestfile2:11:Line11',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1545 \ 'Xqftestfile3:15:Line15',
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1546 \ 'Xqftestfile3:16:Line16']
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1547
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1548 new
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1549 let winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1550 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1551 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
1552 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1553 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
1554 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1555 call assert_equal(winid, win_getid())
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1556 enew
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1557
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1558 set switchbuf=useopen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1559 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1560 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
1561 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1562 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
1563 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1564 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
1565
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1566 enew | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1567 set switchbuf=usetab
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1568 tabedit Xqftestfile1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1569 tabedit Xqftestfile2
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
1570 tabedit Xqftestfile3
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1571 tabfirst
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1572 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1573 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
1574 2cnext
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1575 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
1576 6cnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
1577 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
1578 2cpfile
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
1579 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
1580 2cnfile
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
1581 call assert_equal(4, tabpagenr())
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1582 tabfirst | tabonly | enew
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1583
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1584 set switchbuf=split
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1585 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1586 call assert_equal(1, winnr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1587 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1588 call assert_equal(2, winnr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1589 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1590 call assert_equal(3, winnr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1591 enew | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1592
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1593 set switchbuf=newtab
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1594 cfirst | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1595 call assert_equal(1, tabpagenr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1596 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1597 call assert_equal(2, tabpagenr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1598 cnext | cnext
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1599 call assert_equal(3, tabpagenr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1600 tabfirst | enew | tabonly | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1601
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1602 set switchbuf=
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1603 edit Xqftestfile1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1604 let file1_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1605 new Xqftestfile2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1606 let file2_winid = win_getid()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1607 copen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1608 exe "normal 1G\<CR>"
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1609 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
1610 copen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1611 exe "normal 3G\<CR>"
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1612 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
1613 copen | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1614 exe "normal 5G\<CR>"
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1615 call assert_equal(2, winnr('$'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1616 call assert_equal(1, bufwinnr('Xqftestfile3'))
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1617
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1618 " If only quickfix window is open in the current tabpage, jumping to an
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1619 " entry with 'switchubf' 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
1620 enew | only
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1621 set switchbuf=usetab
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1622 tabedit Xqftestfile1
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1623 tabedit Xqftestfile2
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1624 tabedit Xqftestfile3
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1625 tabfirst
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1626 copen | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1627 clast
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1628 call assert_equal(4, tabpagenr())
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1629 tabfirst | tabonly | enew | only
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1630
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1631 call delete('Xqftestfile1')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1632 call delete('Xqftestfile2')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1633 call delete('Xqftestfile3')
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1634 set switchbuf&vim
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1635
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
1636 enew | only
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1637 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1638
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1639 func Xadjust_qflnum(cchar)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1640 call s:setup_commands(a:cchar)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1641
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1642 enew | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1643
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1644 let fname = 'Xqftestfile' . a:cchar
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1645 call s:create_test_file(fname)
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1646 exe 'edit ' . fname
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1647
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1648 Xgetexpr [fname . ':5:Line5',
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1649 \ fname . ':10:Line10',
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1650 \ fname . ':15:Line15',
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1651 \ fname . ':20:Line20']
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1652
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1653 6,14delete
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1654 call append(6, ['Buffer', 'Window'])
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1655
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1656 let l = g:Xgetlist()
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1657
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1658 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
1659 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
1660 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
1661
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1662 enew!
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1663 call delete(fname)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1664 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1665
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1666 func Test_adjust_lnum()
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1667 call setloclist(0, [])
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1668 call Xadjust_qflnum('c')
9608
fa64afb99dda commit https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504
Christian Brabandt <cb@256bit.org>
parents: 9568
diff changeset
1669 call setqflist([])
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1670 call Xadjust_qflnum('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1671 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1672
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1673 " 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
1674 func s:test_xgrep(cchar)
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1675 call s:setup_commands(a:cchar)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1676
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1677 " 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
1678 " Grep_Test_Text: Match 1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1679 " Grep_Test_Text: Match 2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1680 " GrepAdd_Test_Text: Match 1
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1681 " GrepAdd_Test_Text: Match 2
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1682 enew! | only
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1683 set makeef&vim
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1684 silent Xgrep Grep_Test_Text: test_quickfix.vim
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1685 call assert_true(len(g:Xgetlist()) == 3)
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1686 Xopen
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1687 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
1688 Xclose
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1689 enew
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1690 set makeef=Temp_File_##
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1691 silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1692 call assert_true(len(g:Xgetlist()) == 6)
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1693 endfunc
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1694
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1695 func Test_grep()
9342
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1696 if !has('unix')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1697 " The grepprg may not be set on non-Unix systems
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1698 return
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1699 endif
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1700
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1701 call s:test_xgrep('c')
8ce61744ed94 commit https://github.com/vim/vim/commit/049cba9e9760152b5695399a991dc61cea9ba143
Christian Brabandt <cb@256bit.org>
parents: 9336
diff changeset
1702 call s:test_xgrep('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1703 endfunc
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1704
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1705 func Test_two_windows()
9397
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1706 " 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
1707 " 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
1708 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
1709 call mkdir('Xone/a', 'p')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1710 call mkdir('Xtwo/a', 'p')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1711 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
1712 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
1713 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
1714
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1715 new one
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1716 let one_id = win_getid()
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1717 lexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1718 new two
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1719 let two_id = win_getid()
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1720 lexpr ""
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1721
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1722 laddexpr "Entering dir 'Xtwo/a'"
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1723 call win_gotoid(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1724 laddexpr "Entering dir 'Xone/a'"
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1725 call win_gotoid(two_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1726 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
1727 call win_gotoid(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1728 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
1729
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1730 let loc_one = getloclist(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1731 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
1732 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
1733
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1734 let loc_two = getloclist(two_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1735 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
1736 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
1737
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1738 call win_gotoid(one_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1739 bwipe!
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1740 call win_gotoid(two_id)
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1741 bwipe!
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1742 call delete('Xone', 'rf')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1743 call delete('Xtwo', 'rf')
e08e8b00fe48 commit https://github.com/vim/vim/commit/361c8f0e517e41f1f1d34dae328044406fde80ac
Christian Brabandt <cb@256bit.org>
parents: 9342
diff changeset
1744 endfunc
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
1745
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1746 func XbottomTests(cchar)
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
1747 call s:setup_commands(a:cchar)
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
1748
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
1749 " 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
1750 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
1751 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
1752 endif
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
1753
11502
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
1754 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
1755 Xopen
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
1756 let wid = win_getid()
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
1757 call assert_equal(1, line('.'))
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
1758 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
1759 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
1760 Xbottom
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
1761 call win_gotoid(wid)
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
1762 call assert_equal(2, line('.'))
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
1763 Xclose
9432
abb72f0b9e06 commit https://github.com/vim/vim/commit/dcb170018642ec144cd87d9d9fe076575b8d1263
Christian Brabandt <cb@256bit.org>
parents: 9405
diff changeset
1764 endfunc
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
1765
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
1766 " 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
1767 func Test_cbottom()
9458
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
1768 call XbottomTests('c')
374afcf9d11d commit https://github.com/vim/vim/commit/537ef08408c50e0c4104d57f74993b3b0ed9560d
Christian Brabandt <cb@256bit.org>
parents: 9432
diff changeset
1769 call XbottomTests('l')
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1770 endfunc
9538
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1771
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
1772 func HistoryTest(cchar)
9538
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1773 call s:setup_commands(a:cchar)
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1774
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1775 " 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
1776 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
1777 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
1778 let entry = {'filename': 'foo', 'lnum': 42}
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1779 call g:Xsetlist([entry], 'r')
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1780 call g:Xsetlist([entry, entry])
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1781 call g:Xsetlist([entry, entry, entry])
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1782 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
1783 call assert_equal(3, len(res))
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1784 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
1785 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
1786 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
1787 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
1788
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
1789 call g:Xsetlist([], 'f')
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
1790 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
1791 call assert_equal('No entries', l[0])
9538
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1792 endfunc
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1793
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1794 func Test_history()
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1795 call HistoryTest('c')
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1796 call HistoryTest('l')
26da1efa9e46 commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954
Christian Brabandt <cb@256bit.org>
parents: 9458
diff changeset
1797 endfunc
9540
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1798
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1799 func Test_duplicate_buf()
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1800 " 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
1801 edit DoesNotExist
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1802 edit DoesNotExist2
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1803 let last_buffer = bufnr("$")
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1804
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1805 " 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
1806 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
1807 vimgrep one Xgrepthis
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1808 vimgrep one Xgrepthis
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1809 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
1810
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1811 call delete('Xgrepthis')
64a791c53418 commit https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea
Christian Brabandt <cb@256bit.org>
parents: 9538
diff changeset
1812 endfunc
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1813
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1814 " 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
1815 func Xproperty_tests(cchar)
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1816 call s:setup_commands(a:cchar)
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1817
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1818 " Error cases
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1819 call assert_fails('call g:Xgetlist(99)', 'E715:')
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1820 call assert_fails('call g:Xsetlist(99)', 'E714:')
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1821 call assert_fails('call g:Xsetlist([], "a", [])', 'E715:')
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1822
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1823 " Set and get the title
11263
ae5f9f26f81c patch 8.0.0517: there is no way to remove quickfix lists
Christian Brabandt <cb@256bit.org>
parents: 11195
diff changeset
1824 call g:Xsetlist([])
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1825 Xopen
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1826 wincmd p
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1827 call g:Xsetlist([{'filename':'foo', 'lnum':27}])
11609
6f11697fb92c patch 8.0.0687: minor issues related to quickfix
Christian Brabandt <cb@256bit.org>
parents: 11589
diff changeset
1828 let s = g:Xsetlist([], 'a', {'title' : 'Sample'})
6f11697fb92c patch 8.0.0687: minor issues related to quickfix
Christian Brabandt <cb@256bit.org>
parents: 11589
diff changeset
1829 call assert_equal(0, s)
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1830 let d = g:Xgetlist({"title":1})
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1831 call assert_equal('Sample', d.title)
13760
aef8ba129a4f patch 8.0.1752: qf_set_properties() is to long
Christian Brabandt <cb@256bit.org>
parents: 13756
diff changeset
1832 " Try setting title to a non-string value
aef8ba129a4f patch 8.0.1752: qf_set_properties() is to long
Christian Brabandt <cb@256bit.org>
parents: 13756
diff changeset
1833 call assert_equal(-1, g:Xsetlist([], 'a', {'title' : ['Test']}))
aef8ba129a4f patch 8.0.1752: qf_set_properties() is to long
Christian Brabandt <cb@256bit.org>
parents: 13756
diff changeset
1834 call assert_equal('Sample', g:Xgetlist({"title":1}).title)
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1835
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1836 Xopen
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1837 call assert_equal('Sample', w:quickfix_title)
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1838 Xclose
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1839
9982
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1840 " Tests for action argument
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1841 silent! Xolder 999
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1842 let qfnr = g:Xgetlist({'all':1}).nr
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1843 call g:Xsetlist([], 'r', {'title' : 'N1'})
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1844 call assert_equal('N1', g:Xgetlist({'all':1}).title)
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1845 call g:Xsetlist([], ' ', {'title' : 'N2'})
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1846 call assert_equal(qfnr + 1, g:Xgetlist({'all':1}).nr)
10237
197795e3530d commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents: 10056
diff changeset
1847
197795e3530d commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents: 10056
diff changeset
1848 let res = g:Xgetlist({'nr': 0})
197795e3530d commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents: 10056
diff changeset
1849 call assert_equal(qfnr + 1, res.nr)
197795e3530d commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents: 10056
diff changeset
1850 call assert_equal(['nr'], keys(res))
197795e3530d commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents: 10056
diff changeset
1851
9982
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1852 call g:Xsetlist([], ' ', {'title' : 'N3'})
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1853 call assert_equal('N2', g:Xgetlist({'nr':2, 'title':1}).title)
e24aa20d815c commit https://github.com/vim/vim/commit/2b529bb6260b52246e92429375d995b9b5ce76b6
Christian Brabandt <cb@256bit.org>
parents: 9850
diff changeset
1854
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1855 " Changing the title of an earlier quickfix list
12084
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
1856 call g:Xsetlist([], 'r', {'title' : 'NewTitle', 'nr' : 2})
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1857 call assert_equal('NewTitle', g:Xgetlist({'nr':2, 'title':1}).title)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1858
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1859 " Changing the title of an invalid quickfix list
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1860 call assert_equal(-1, g:Xsetlist([], ' ',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1861 \ {'title' : 'SomeTitle', 'nr' : 99}))
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1862 call assert_equal(-1, g:Xsetlist([], ' ',
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1863 \ {'title' : 'SomeTitle', 'nr' : 'abc'}))
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1864
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1865 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
1866 copen
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1867 call assert_equal({'winid':win_getid()}, getqflist({'winid':1}))
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1868 cclose
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1869 endif
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
1870
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1871 " Invalid arguments
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1872 call assert_fails('call g:Xgetlist([])', 'E715')
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1873 call assert_fails('call g:Xsetlist([], "a", [])', 'E715')
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1874 let s = g:Xsetlist([], 'a', {'abc':1})
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1875 call assert_equal(-1, s)
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1876
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1877 call assert_equal({}, g:Xgetlist({'abc':1}))
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
1878 call assert_equal('', g:Xgetlist({'nr':99, 'title':1}).title)
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
1879 call assert_equal('', g:Xgetlist({'nr':[], 'title':1}).title)
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1880
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1881 if a:cchar == 'l'
10237
197795e3530d commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Christian Brabandt <cb@256bit.org>
parents: 10056
diff changeset
1882 call assert_equal({}, getloclist(99, {'title': 1}))
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
1883 endif
11412
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1884
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1885 " Context related tests
11609
6f11697fb92c patch 8.0.0687: minor issues related to quickfix
Christian Brabandt <cb@256bit.org>
parents: 11589
diff changeset
1886 let s = g:Xsetlist([], 'a', {'context':[1,2,3]})
6f11697fb92c patch 8.0.0687: minor issues related to quickfix
Christian Brabandt <cb@256bit.org>
parents: 11589
diff changeset
1887 call assert_equal(0, s)
11412
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1888 call test_garbagecollect_now()
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1889 let d = g:Xgetlist({'context':1})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1890 call assert_equal([1,2,3], d.context)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1891 call g:Xsetlist([], 'a', {'context':{'color':'green'}})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1892 let d = g:Xgetlist({'context':1})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1893 call assert_equal({'color':'green'}, d.context)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1894 call g:Xsetlist([], 'a', {'context':"Context info"})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1895 let d = g:Xgetlist({'context':1})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1896 call assert_equal("Context info", d.context)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1897 call g:Xsetlist([], 'a', {'context':246})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1898 let d = g:Xgetlist({'context':1})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1899 call assert_equal(246, d.context)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1900 if a:cchar == 'l'
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1901 " Test for copying context across two different location lists
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1902 new | only
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1903 let w1_id = win_getid()
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1904 let l = [1]
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1905 call setloclist(0, [], 'a', {'context':l})
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1906 new
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1907 let w2_id = win_getid()
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1908 call add(l, 2)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1909 call assert_equal([1, 2], getloclist(w1_id, {'context':1}).context)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1910 call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1911 unlet! l
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1912 call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context)
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1913 only
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1914 call setloclist(0, [], 'f')
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
1915 call assert_equal('', getloclist(0, {'context':1}).context)
11412
84baca75b7f2 patch 8.0.0590: cannot add a context to locations
Christian Brabandt <cb@256bit.org>
parents: 11390
diff changeset
1916 endif
11445
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1917
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1918 " Test for changing the context of previous quickfix lists
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1919 call g:Xsetlist([], 'f')
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1920 Xexpr "One"
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1921 Xexpr "Two"
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1922 Xexpr "Three"
12084
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
1923 call g:Xsetlist([], 'r', {'context' : [1], 'nr' : 1})
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
1924 call g:Xsetlist([], 'a', {'context' : [2], 'nr' : 2})
11445
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1925 " Also, check for setting the context using quickfix list number zero.
12084
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
1926 call g:Xsetlist([], 'r', {'context' : [3], 'nr' : 0})
11445
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1927 call test_garbagecollect_now()
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1928 let l = g:Xgetlist({'nr' : 1, 'context' : 1})
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1929 call assert_equal([1], l.context)
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1930 let l = g:Xgetlist({'nr' : 2, 'context' : 1})
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1931 call assert_equal([2], l.context)
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1932 let l = g:Xgetlist({'nr' : 3, 'context' : 1})
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1933 call assert_equal([3], l.context)
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1934
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1935 " Test for changing the context through reference and for garbage
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1936 " collection of quickfix context
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1937 let l = ["red"]
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1938 call g:Xsetlist([], ' ', {'context' : l})
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1939 call add(l, "blue")
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1940 let x = g:Xgetlist({'context' : 1})
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1941 call add(x.context, "green")
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1942 call assert_equal(["red", "blue", "green"], l)
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1943 call assert_equal(["red", "blue", "green"], x.context)
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1944 unlet l
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1945 call test_garbagecollect_now()
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1946 let m = g:Xgetlist({'context' : 1})
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
1947 call assert_equal(["red", "blue", "green"], m.context)
11549
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1948
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1949 " Test for setting/getting items
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1950 Xexpr ""
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1951 let qfprev = g:Xgetlist({'nr':0})
11609
6f11697fb92c patch 8.0.0687: minor issues related to quickfix
Christian Brabandt <cb@256bit.org>
parents: 11589
diff changeset
1952 let s = g:Xsetlist([], ' ', {'title':'Green',
11549
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1953 \ 'items' : [{'filename':'F1', 'lnum':10}]})
11609
6f11697fb92c patch 8.0.0687: minor issues related to quickfix
Christian Brabandt <cb@256bit.org>
parents: 11589
diff changeset
1954 call assert_equal(0, s)
11549
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1955 let qfcur = g:Xgetlist({'nr':0})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1956 call assert_true(qfcur.nr == qfprev.nr + 1)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1957 let l = g:Xgetlist({'items':1})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1958 call assert_equal('F1', bufname(l.items[0].bufnr))
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1959 call assert_equal(10, l.items[0].lnum)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1960 call g:Xsetlist([], 'a', {'items' : [{'filename':'F2', 'lnum':20},
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1961 \ {'filename':'F2', 'lnum':30}]})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1962 let l = g:Xgetlist({'items':1})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1963 call assert_equal('F2', bufname(l.items[2].bufnr))
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1964 call assert_equal(30, l.items[2].lnum)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1965 call g:Xsetlist([], 'r', {'items' : [{'filename':'F3', 'lnum':40}]})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1966 let l = g:Xgetlist({'items':1})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1967 call assert_equal('F3', bufname(l.items[0].bufnr))
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1968 call assert_equal(40, l.items[0].lnum)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1969 call g:Xsetlist([], 'r', {'items' : []})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1970 let l = g:Xgetlist({'items':1})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1971 call assert_equal(0, len(l.items))
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1972
12427
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
1973 call g:Xsetlist([], 'r', {'title' : 'TestTitle'})
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
1974 call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F1', 'lnum' : 10, 'text' : 'L10'}]})
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
1975 call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F1', 'lnum' : 10, 'text' : 'L10'}]})
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
1976 call assert_equal('TestTitle', g:Xgetlist({'title' : 1}).title)
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
1977
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
1978 " Test for getting id of window associated with a location list window
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1979 if a:cchar == 'l'
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1980 only
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1981 call assert_equal(0, g:Xgetlist({'all' : 1}).filewinid)
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1982 let wid = win_getid()
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1983 Xopen
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1984 call assert_equal(wid, g:Xgetlist({'filewinid' : 1}).filewinid)
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1985 wincmd w
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1986 call assert_equal(0, g:Xgetlist({'filewinid' : 1}).filewinid)
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1987 only
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1988 endif
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
1989
12048
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
1990 " The following used to crash Vim with address sanitizer
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
1991 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
1992 call g:Xsetlist([], 'a', {'items' : [{'filename':'F1', 'lnum':10}]})
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
1993 call assert_equal(10, g:Xgetlist({'items':1}).items[0].lnum)
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
1994
13760
aef8ba129a4f patch 8.0.1752: qf_set_properties() is to long
Christian Brabandt <cb@256bit.org>
parents: 13756
diff changeset
1995 " Try setting the items using a string
aef8ba129a4f patch 8.0.1752: qf_set_properties() is to long
Christian Brabandt <cb@256bit.org>
parents: 13756
diff changeset
1996 call assert_equal(-1, g:Xsetlist([], ' ', {'items' : 'Test'}))
aef8ba129a4f patch 8.0.1752: qf_set_properties() is to long
Christian Brabandt <cb@256bit.org>
parents: 13756
diff changeset
1997
11549
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1998 " Save and restore the quickfix stack
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
1999 call g:Xsetlist([], 'f')
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2000 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2001 Xexpr "File1:10:Line1"
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2002 Xexpr "File2:20:Line2"
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2003 Xexpr "File3:30:Line3"
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2004 let last_qf = g:Xgetlist({'nr':'$'}).nr
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2005 call assert_equal(3, last_qf)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2006 let qstack = []
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2007 for i in range(1, last_qf)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2008 let qstack = add(qstack, g:Xgetlist({'nr':i, 'all':1}))
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2009 endfor
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2010 call g:Xsetlist([], 'f')
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2011 for i in range(len(qstack))
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2012 call g:Xsetlist([], ' ', qstack[i])
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2013 endfor
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2014 call assert_equal(3, g:Xgetlist({'nr':'$'}).nr)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2015 call assert_equal(10, g:Xgetlist({'nr':1, 'items':1}).items[0].lnum)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2016 call assert_equal(20, g:Xgetlist({'nr':2, 'items':1}).items[0].lnum)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2017 call assert_equal(30, g:Xgetlist({'nr':3, 'items':1}).items[0].lnum)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2018 call g:Xsetlist([], 'f')
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2019
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2020 " Swap two quickfix lists
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2021 Xexpr "File1:10:Line10"
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2022 Xexpr "File2:20:Line20"
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2023 Xexpr "File3:30:Line30"
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2024 call g:Xsetlist([], 'r', {'nr':1,'title':'Colors','context':['Colors']})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2025 call g:Xsetlist([], 'r', {'nr':2,'title':'Fruits','context':['Fruits']})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2026 let l1=g:Xgetlist({'nr':1,'all':1})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2027 let l2=g:Xgetlist({'nr':2,'all':1})
12287
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2028 let save_id = l1.id
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2029 let l1.id=l2.id
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2030 let l2.id=save_id
11549
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2031 call g:Xsetlist([], 'r', l1)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2032 call g:Xsetlist([], 'r', l2)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2033 let newl1=g:Xgetlist({'nr':1,'all':1})
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2034 let newl2=g:Xgetlist({'nr':2,'all':1})
12427
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
2035 call assert_equal('Fruits', newl1.title)
11549
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2036 call assert_equal(['Fruits'], newl1.context)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2037 call assert_equal('Line20', newl1.items[0].text)
12427
fc3e2d5614dd patch 8.0.1093: various small quickfix issues
Christian Brabandt <cb@256bit.org>
parents: 12321
diff changeset
2038 call assert_equal('Colors', newl2.title)
11549
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2039 call assert_equal(['Colors'], newl2.context)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2040 call assert_equal('Line10', newl2.items[0].text)
f5add45f9848 patch 8.0.0657: cannot get and set quickfix list items
Christian Brabandt <cb@256bit.org>
parents: 11502
diff changeset
2041 call g:Xsetlist([], 'f')
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2042 endfunc
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
2043
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2044 func Test_qf_property()
9850
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
2045 call Xproperty_tests('c')
67781bb0a61a commit https://github.com/vim/vim/commit/d823fa910cca43fec3c31c030ee908a14c272640
Christian Brabandt <cb@256bit.org>
parents: 9752
diff changeset
2046 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
2047 endfunc
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2048
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2049 " 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
2050 func QfAutoCmdHandler(loc, cmd)
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2051 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
2052 endfunc
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2053
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2054 func Test_Autocmd()
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2055 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
2056 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
2057
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2058 let g:acmds = []
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2059 cexpr "F1:10:Line 10"
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2060 caddexpr "F1:20:Line 20"
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2061 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
2062 cexpr ""
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2063 caddexpr ""
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2064 cgetexpr ""
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2065 silent! cexpr non_existing_func()
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2066 silent! caddexpr non_existing_func()
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2067 silent! cgetexpr non_existing_func()
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2068 let l = ['precexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2069 \ 'postcexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2070 \ 'precaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2071 \ 'postcaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2072 \ 'precgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2073 \ 'postcgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2074 \ 'precexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2075 \ 'postcexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2076 \ 'precaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2077 \ 'postcaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2078 \ 'precgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2079 \ 'postcgetexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2080 \ 'precexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2081 \ 'precaddexpr',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2082 \ 'precgetexpr']
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2083 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
2084
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2085 let g:acmds = []
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2086 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
2087 cbuffer!
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2088 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
2089 cgetbuffer
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2090 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
2091 caddbuffer
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2092 new
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2093 let bnum = bufnr('%')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2094 bunload
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2095 exe 'silent! cbuffer! ' . bnum
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2096 exe 'silent! cgetbuffer ' . bnum
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2097 exe 'silent! caddbuffer ' . bnum
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2098 enew!
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2099 let l = ['precbuffer',
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2100 \ 'postcbuffer',
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2101 \ 'precgetbuffer',
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2102 \ 'postcgetbuffer',
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2103 \ 'precaddbuffer',
12954
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2104 \ 'postcaddbuffer',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2105 \ 'precbuffer',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2106 \ 'precgetbuffer',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2107 \ 'precaddbuffer']
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2108 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
2109
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2110 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
2111 call writefile([], 'Xempty')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2112 let g:acmds = []
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2113 cfile Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2114 caddfile Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2115 cgetfile Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2116 cfile Xempty
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2117 caddfile Xempty
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2118 cgetfile Xempty
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2119 silent! cfile do_not_exist
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2120 silent! caddfile do_not_exist
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2121 silent! cgetfile do_not_exist
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2122 let l = ['precfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2123 \ 'postcfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2124 \ 'precaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2125 \ 'postcaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2126 \ 'precgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2127 \ 'postcgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2128 \ 'precfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2129 \ 'postcfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2130 \ 'precaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2131 \ 'postcaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2132 \ 'precgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2133 \ 'postcgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2134 \ 'precfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2135 \ 'postcfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2136 \ 'precaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2137 \ 'postcaddfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2138 \ 'precgetfile',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2139 \ 'postcgetfile']
10056
21f685af3fc1 commit https://github.com/vim/vim/commit/04c4ce650f9e533cd35b2aa6803f4d354d3ec7aa
Christian Brabandt <cb@256bit.org>
parents: 9982
diff changeset
2140 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
2141
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2142 let g:acmds = []
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2143 helpgrep quickfix
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2144 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
2145 vimgrep test Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2146 vimgrepadd test Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2147 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
2148 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
2149 set makeprg=
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2150 silent! make
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2151 set makeprg&
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2152 let l = ['prehelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2153 \ 'posthelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2154 \ 'prehelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2155 \ 'posthelpgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2156 \ 'previmgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2157 \ 'postvimgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2158 \ 'previmgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2159 \ 'postvimgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2160 \ 'previmgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2161 \ 'postvimgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2162 \ 'previmgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2163 \ 'postvimgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2164 \ 'premake',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2165 \ 'postmake']
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2166 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
2167
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2168 if has('unix')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2169 " 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
2170 " non-Unix systems.
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2171 " 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
2172 " Grep_Autocmd_Text: Match 1
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2173 " GrepAdd_Autocmd_Text: Match 2
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2174 let g:acmds = []
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2175 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
2176 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
2177 silent grep abc123def Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2178 silent grepadd abc123def Xtest
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2179 let l = ['pregrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2180 \ 'postgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2181 \ 'pregrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2182 \ 'postgrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2183 \ 'pregrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2184 \ 'postgrep',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2185 \ 'pregrepadd',
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2186 \ 'postgrepadd']
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2187 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
2188 endif
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2189
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2190 call delete('Xtest')
49e136457c66 patch 8.0.1353: QuickFixCmdPost is not used consistently
Christian Brabandt <cb@256bit.org>
parents: 12692
diff changeset
2191 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
2192 au! QuickFixCmdPre
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
2193 au! QuickFixCmdPost
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2194 endfunc
10346
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2195
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2196 func Test_Autocmd_Exception()
10346
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2197 set efm=%m
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2198 lgetexpr '?'
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2199
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2200 try
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2201 call DoesNotExit()
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2202 catch
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2203 lgetexpr '1'
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2204 finally
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2205 lgetexpr '1'
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2206 endtry
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2207
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2208 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
2209
d52d97bf675e commit https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
Christian Brabandt <cb@256bit.org>
parents: 10281
diff changeset
2210 set efm&vim
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2211 endfunc
10367
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2212
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2213 func Test_caddbuffer_wrong()
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2214 " 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
2215 let save_efm = &efm
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2216 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
2217 cgetexpr ['WWWW', 'EEEE', 'CCCC']
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2218 let &efm = save_efm
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2219 caddbuffer
10367
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2220 bwipe!
4e4e116e3689 commit https://github.com/vim/vim/commit/63bed3d319b5d90765dbdae93a3579b6322d79fb
Christian Brabandt <cb@256bit.org>
parents: 10346
diff changeset
2221 endfunc
10369
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2222
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2223 func Test_caddexpr_wrong()
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2224 " 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
2225 cbuffer
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2226 cbuffer
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2227 copen
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2228 let save_efm = &efm
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2229 set efm=%
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2230 call assert_fails('caddexpr ""', 'E376:')
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2231 let &efm = save_efm
4e5b307638cb commit https://github.com/vim/vim/commit/2b946c9f9b0e0fd805fb8f3e4c16e0a68ae13129
Christian Brabandt <cb@256bit.org>
parents: 10367
diff changeset
2232 endfunc
10379
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2233
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2234 func Test_dirstack_cleanup()
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2235 " 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
2236 let save_efm = &efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2237 lexpr '0'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2238 lopen
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2239 fun X(c)
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2240 let save_efm=&efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2241 set efm=%D%f
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2242 if a:c == 'c'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2243 caddexpr '::'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2244 else
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2245 laddexpr ':0:0'
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2246 endif
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2247 let &efm=save_efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2248 endfun
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2249 call X('c')
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2250 call X('l')
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2251 call setqflist([], 'r')
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2252 caddbuffer
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2253 let &efm = save_efm
73e2a7abe2a3 commit https://github.com/vim/vim/commit/7618e00d3b8bfe064cfc524640d754607361f9df
Christian Brabandt <cb@256bit.org>
parents: 10369
diff changeset
2254 endfunc
11030
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2255
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2256 " 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
2257 " window
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2258 func Test_cwindow_jump()
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2259 set efm=%f%%%l%%%m
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2260 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
2261 lopen | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2262 lfirst
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2263 call assert_true(winnr('$') == 2)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2264 call assert_true(winnr() == 1)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2265 " 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
2266 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
2267
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2268 " Open a scratch buffer
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2269 " 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
2270 " 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
2271 " Jump to an entry.
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2272 " Should create a new window and jump to the entry. The scrtach buffer
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2273 " should not be used.
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2274 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2275 set buftype=nofile
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2276 below new
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2277 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
2278 lopen
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2279 2wincmd c
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2280 lnext
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2281 call assert_true(winnr('$') == 3)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2282 call assert_true(winnr() == 2)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2283
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2284 " 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
2285 " 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
2286 " 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
2287 " 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
2288 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2289 lgetexpr ["F1%5%Line 5"]
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2290 below new
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2291 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
2292 lopen
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2293 2wincmd c
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2294 lnext
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2295 call assert_true(winnr() == 1)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2296 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
2297
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2298 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2299 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
2300 copen
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2301 cnext
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2302 call assert_true(winnr('$') == 2)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2303 call assert_true(winnr() == 1)
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2304
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2305 enew | only
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2306 set efm&vim
9d40a98f0834 patch 8.0.0404: not enough testing for quickfix
Christian Brabandt <cb@256bit.org>
parents: 10379
diff changeset
2307 endfunc
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2308
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2309 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
2310 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
2311
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2312 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
2313 \ '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
2314 \ 'Editor:Notepad NOTEPAD'], 'Xtestfile1')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2315 call writefile(['Linux', 'MacOS', 'MS-Windows'], 'Xtestfile2')
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2316
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2317 " Error cases
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2318 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
2319
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2320 let @/=''
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2321 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
2322
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2323 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
2324 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
2325 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
2326
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2327 Xexpr ""
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2328 Xvimgrepadd Notepad Xtestfile1
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2329 Xvimgrepadd MacOS Xtestfile2
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2330 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
2331 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
2332 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
2333
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2334 Xvimgrep #\cvim#g Xtestfile?
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2335 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
2336 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
2337 call assert_equal(8, l[0].col)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2338 call assert_equal(12, l[1].col)
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2339
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2340 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
2341 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
2342 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
2343 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
2344
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2345 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
2346 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
2347 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
2348 call assert_equal('Xtestfile2', bufname(''))
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2349 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
2350
13764
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
2351 " 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
2352 %bwipe
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
2353 Xvimgrep /Editor/j Xtestfile*
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
2354 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
2355 call assert_equal([], getbufinfo('Xtestfile2'))
7bba231fdddc patch 8.0.1754: ex_helpgrep() is too long
Christian Brabandt <cb@256bit.org>
parents: 13760
diff changeset
2356
11195
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2357 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
2358 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
2359 endfunc
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2360
13c660bd07b2 patch 8.0.0484: :lhelpgrep does not fail after a successful one
Christian Brabandt <cb@256bit.org>
parents: 11030
diff changeset
2361 " 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
2362 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
2363 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
2364 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
2365 endfunc
11301
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2366
14976
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2367 " 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
2368 " 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
2369 func Test_vimgrep_incsearch()
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2370 enew
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2371 set incsearch
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2372 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
2373
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2374 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
2375 let l = getqflist()
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2376 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
2377
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2378 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
2379 set noincsearch
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2380 endfunc
676db1b7fc35 patch 8.1.0499: :2vimgrep causes an ml_get error
Bram Moolenaar <Bram@vim.org>
parents: 14956
diff changeset
2381
11301
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2382 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
2383 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
2384
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2385 enew | only
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2386
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2387 " 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
2388 " 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
2389 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
2390 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
2391 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
2392 Xolder
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2393 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
2394 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
2395
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2396 " 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
2397 " single list.
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2398 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
2399 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
2400
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2401 " 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
2402 " 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
2403 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
2404 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
2405 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
2406 Xolder
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2407 Xwindow
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2408 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
2409 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
2410 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
2411 Xclose
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2412
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2413 " 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
2414 " 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
2415 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
2416 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
2417 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
2418 Xolder
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2419 Xwindow
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2420 wincmd p
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2421 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
2422 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
2423 wincmd p
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2424 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
2425 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
2426
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2427 " 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
2428 " 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
2429 " 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
2430 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
2431 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
2432 wincmd p
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2433 lopen
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2434 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
2435 endif
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2436 Xclose
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2437 endfunc
cc8ece2aa389 patch 8.0.0536: quickfix window not updated when freeing quickfix stack
Christian Brabandt <cb@256bit.org>
parents: 11263
diff changeset
2438
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2439 " 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
2440 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
2441 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
2442 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
2443 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
2444
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
2445 " 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
2446 " 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
2447 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
2448 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
2449 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
2450
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
2451 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
2452 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
2453
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
2454 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
2455 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
2456 \ '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
2457 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
2458 endfunc
461ac47c3793 patch 8.0.0606: cannot set the context for a specified quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11412
diff changeset
2459
11502
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2460 " 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
2461 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
2462 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
2463
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2464 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
2465 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
2466 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
2467 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
2468
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2469 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
2470 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
2471 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
2472 Xolder | Xolder
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2473 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
2474 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
2475
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2476 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
2477 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
2478 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
2479 Xolder | Xolder
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2480 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
2481 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
2482 endfunc
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2483
46bbef0ee9a6 patch 8.0.0634: cannot easily get to the last quickfix list
Christian Brabandt <cb@256bit.org>
parents: 11445
diff changeset
2484 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
2485 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
2486 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
2487 endfunc
11589
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2488
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2489 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
2490 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
2491 au!
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2492 au FileType qf :call assert_fails(':cclose', 'E788')
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2493 augroup END
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2494 copen
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2495 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
2496 au!
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2497 augroup END
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2498 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
2499 endfunc
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2500
11589
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2501 func Test_cclose_in_autocmd()
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2502 " 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
2503 " event will be triggered.
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2504 call test_override('starting', 1)
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2505 augroup QF_Test
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2506 au!
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2507 au FileType qf :call assert_fails(':cclose', 'E788')
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2508 augroup END
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2509 copen
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2510 augroup QF_Test
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2511 au!
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2512 augroup END
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2513 augroup! QF_Test
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2514 call test_override('starting', 0)
39787def24bb patch 8.0.0677: setting 'filetype' may switch buffers
Christian Brabandt <cb@256bit.org>
parents: 11549
diff changeset
2515 endfunc
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2516
14648
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2517 " 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
2518 " is set.
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2519 func Test_file_from_copen()
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2520 " Works without argument.
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2521 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2522 au!
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2523 au FileType qf file
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2524 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2525 copen
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2526
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2527 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2528 au!
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2529 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2530 cclose
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2531
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2532 " Fails with argument.
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2533 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2534 au!
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2535 au FileType qf call assert_fails(':file foo', 'E788')
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2536 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2537 copen
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2538 augroup QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2539 au!
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2540 augroup END
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2541 cclose
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2542
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2543 augroup! QF_Test
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2544 endfunction
c3222a7342ab patch 8.1.0337: :file fails in quickfix command
Christian Brabandt <cb@256bit.org>
parents: 14603
diff changeset
2545
11611
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2546 func Test_resize_from_copen()
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2547 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
2548 au!
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2549 au FileType qf resize 5
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2550 augroup END
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2551 try
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2552 " This should succeed without any exception. No other buffers are
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2553 " involved in the autocmd.
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2554 copen
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2555 finally
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2556 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
2557 au!
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2558 augroup END
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2559 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
2560 endtry
9dc041e1c8c9 patch 8.0.0688: cannot resize the window in a FileType autocommand
Christian Brabandt <cb@256bit.org>
parents: 11609
diff changeset
2561 endfunc
11705
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2562
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2563 " 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
2564 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
2565 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
2566
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2567 new | only
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2568
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2569 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
2570
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2571 Xopen
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2572 Xolder
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2573 Xolder
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2574 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
2575 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
2576 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
2577 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
2578 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
2579 Xclose
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2580 endfunc
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2581
c43118ecb0a3 patch 8.0.0735: no indication that the quickfix window/buffer changed
Christian Brabandt <cb@256bit.org>
parents: 11611
diff changeset
2582 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
2583 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
2584 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
2585 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2586
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2587 " 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
2588 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
2589 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
2590
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2591 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
2592 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
2593 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
2594
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2595 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
2596 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
2597 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
2598 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
2599 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
2600 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
2601 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
2602 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
2603 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
2604 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
2605
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2606 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
2607 " 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
2608 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
2609 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
2610 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
2611 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
2612 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
2613 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
2614
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
2615 " 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
2616 set efm&
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
2617 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
2618 \ '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
2619 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
2620 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
2621 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
2622 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
2623 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
2624 \ '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
2625 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2626
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2627 func Test_setexpr()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2628 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
2629 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
2630 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2631
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2632 " 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
2633 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
2634 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
2635
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2636 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
2637 Xexpr "" | Xexpr ""
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2638
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
2639 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
2640 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
2641 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
2642 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
2643
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2644 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
2645 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
2646 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
2647 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
2648 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
2649 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
2650 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2651
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2652 func Test_multidirstack()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2653 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
2654 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
2655 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
2656 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
2657 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
2658 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
2659 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
2660
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2661 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
2662 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
2663
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2664 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
2665 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
2666 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
2667 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2668
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2669 " 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
2670 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
2671 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
2672
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2673 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
2674 Xexpr "" | Xexpr ""
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2675
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
2676 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
2677 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
2678 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
2679 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
2680
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2681 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
2682 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
2683 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
2684 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
2685 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
2686 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
2687
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2688 " 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
2689 " error line ends with a file stack.
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2690 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
2691 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
2692 let l = g:Xgetlist({'lines' : [
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2693 \ '(one.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2694 \ 'Error l4 in one.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2695 \ ') (two.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2696 \ 'Error l6 in two.txt',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2697 \ ')',
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2698 \ 'Error l8 in one.txt'
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2699 \ ], 'efm' : efm_val})
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2700 call assert_equal(3, len(l.items))
89223f5d5d12 patch 8.0.1678: errorformat "%r" implies "%>"
Christian Brabandt <cb@256bit.org>
parents: 13594
diff changeset
2701 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
2702 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
2703 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
2704 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
2705 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
2706 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
2707 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
2708 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
2709 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
2710 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2711
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2712 func Test_multifilestack()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2713 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
2714 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
2715 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
2716 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
2717 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
2718
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2719 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
2720 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
2721
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2722 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
2723 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
2724 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
2725 endfunc
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2726
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2727 " 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
2728 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
2729 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
2730 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
2731 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
2732 new | only
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2733 new
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2734 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
2735 cfile one.txt
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2736 wincmd w
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2737 caddfile two.txt
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2738
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2739 let l = getqflist()
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2740 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
2741 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
2742
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2743 set efm&
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2744 new | only
ebd313aa5a6c patch 8.0.0904: cannot set a location list from text
Christian Brabandt <cb@256bit.org>
parents: 11800
diff changeset
2745 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
2746 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
2747 endfunc
11800
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2748
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2749 " 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
2750 " 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
2751 func Test_Multi_LL_Help()
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2752 new | only
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2753 lhelpgrep window
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2754 lopen
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2755 e#
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2756 lhelpgrep buffer
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2757 call assert_equal(3, winnr('$'))
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2758 call assert_true(len(getloclist(1)) != 0)
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2759 call assert_true(len(getloclist(2)) != 0)
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2760 new | only
5ceaecedbad2 patch 8.0.0782: using freed memory in quickfix code
Christian Brabandt <cb@256bit.org>
parents: 11705
diff changeset
2761 endfunc
12084
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2762
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2763 " 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
2764 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
2765 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
2766
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2767 " 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
2768 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
2769 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
2770 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
2771 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
2772 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
2773
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2774 " 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
2775 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
2776 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
2777 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
2778 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
2779 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
2780
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2781 " 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
2782 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
2783 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
2784 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
2785 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
2786 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
2787
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2788 " 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
2789 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
2790 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
2791 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
2792 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
2793 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
2794 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
2795
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2796 " 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
2797 " list.
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2798 Xexpr "" | Xexpr "" | Xexpr ""
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2799 silent! 10Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2800 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
2801 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
2802 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
2803 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
2804
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2805 " 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
2806 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
2807 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2808 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
2809 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
2810 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
2811 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
2812
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2813 " 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
2814 " list size.
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2815 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
2816 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2817 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
2818 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
2819 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
2820 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
2821
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2822 " 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
2823 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
2824 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2825 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
2826 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
2827 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
2828 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
2829
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2830 " 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
2831 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
2832
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2833 " 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
2834 " 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
2835 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
2836 Xexpr "" | Xexpr "" | Xexpr ""
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2837 silent! 99Xolder
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2838 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
2839
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2840 " 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
2841 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
2842 endfunc
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2843
69ce6b3f0834 patch 8.0.0922: quickfix list always added after current one
Christian Brabandt <cb@256bit.org>
parents: 12048
diff changeset
2844 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
2845 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
2846 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
2847 endfunc
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
2848
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
2849 " 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
2850 " the quickfix stack
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
2851 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
2852 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
2853 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
2854
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
2855 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
2856 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
2857 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
2858
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
2859 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
2860 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
2861 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
2862 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
2863
12321
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
2864 " 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
2865 set efm&
2779d593a706 patch 8.0.1040: cannot use another error format in getqflist()
Christian Brabandt <cb@256bit.org>
parents: 12303
diff changeset
2866 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
2867 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
2868 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
2869 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
2870 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
2871 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
2872 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
2873 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
2874
12252
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
2875 " 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
2876 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
2877 endfunc
3d0e042ec13c patch 8.0.1006: quickfix list changes when parsing text with 'erroformat'
Christian Brabandt <cb@256bit.org>
parents: 12084
diff changeset
2878
12303
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
2879 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
2880 call XgetListFromLines('c')
ec7a4fd21dd5 patch 8.0.1031: "text" argument for getqflist() is confusing
Christian Brabandt <cb@256bit.org>
parents: 12299
diff changeset
2881 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
2882 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
2883
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2884 " 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
2885 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
2886 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
2887
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2888 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
2889 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
2890 Xexpr ''
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2891 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
2892 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
2893 Xolder
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2894 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
2895 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
2896 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
2897 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
2898 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
2899 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
2900 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
2901
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2902 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
2903 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
2904 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
2905 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
2906 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
2907 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
2908
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2909 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
2910 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
2911 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
2912 endfunc
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2913
20641a7e1fc9 patch 8.0.1023: it is not easy to identify a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 12252
diff changeset
2914 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
2915 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
2916 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
2917 endfunc
13016
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2918
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2919 func Xqfjump_tests(cchar)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2920 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
2921
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2922 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
2923 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
2924 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
2925
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2926 call g:Xsetlist([], 'f')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2927
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2928 " Tests for
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2929 " 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
2930 " 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
2931 " 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
2932 let l = []
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2933 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
2934 call add(l, {})
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2935 endfor
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2936 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
2937 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
2938 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
2939 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
2940 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
2941 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
2942 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
2943 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
2944 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
2945 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
2946 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
2947 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
2948 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
2949 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
2950 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
2951 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
2952 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
2953 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
2954
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2955 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
2956 Xopen | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2957 2Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2958 call assert_equal(3, 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
2959 call assert_equal('F3', bufname('%'))
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2960 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2961 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
2962 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2963 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
2964 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2965 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
2966 2
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2967 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2968 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
2969
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2970 if a:cchar == 'l'
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2971 " 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
2972 " 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
2973 enew! | new | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2974 call g:Xsetlist([], 'f')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2975 setlocal buftype=nofile
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2976 new
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2977 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
2978 Xopen
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2979 let winid = win_getid()
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2980 wincmd p
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2981 close
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2982 call win_gotoid(winid)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2983 Xnext
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2984 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
2985 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
2986 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
2987
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2988 " 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
2989 " 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
2990 " 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
2991 close
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2992 belowright new
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2993 call g:Xsetlist([], 'f')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2994 edit F3
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2995 call win_gotoid(winid)
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2996 Xlast
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
2997 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
2998 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
2999 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
3000 endif
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3001
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3002 " Cleanup
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3003 enew!
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3004 new | only
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3005
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3006 call delete('F1')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3007 call delete('F2')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3008 call delete('F3')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3009 endfunc
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3010
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3011 func Test_qfjump()
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3012 call Xqfjump_tests('c')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3013 call Xqfjump_tests('l')
e47e70300f30 patch 8.0.1384: not enough quickfix help; confusing winid
Christian Brabandt <cb@256bit.org>
parents: 12954
diff changeset
3014 endfunc
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3015
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3016 " 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
3017 " 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
3018 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
3019 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
3020
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3021 " Empty quickfix stack
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3022 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
3023 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
3024 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
3025 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
3026 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
3027 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
3028 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
3029 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
3030 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
3031 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
3032 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
3033 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
3034 \ 'items' : [], 'nr' : 0, 'size' : 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
3035 \ 'title' : '', 'winid' : 0, 'changedtick': 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
3036 \ 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
3037 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
3038 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
3039 \ 'items' : [], 'nr' : 0, 'size' : 0, 'title' : '',
8770189c3e22 patch 8.1.0345: cannot get the window id associated with the location list
Christian Brabandt <cb@256bit.org>
parents: 14648
diff changeset
3040 \ 'winid' : 0, 'changedtick': 0, 'filewinid' : 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
3041 \ 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
3042 endif
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3043
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
3044 " 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
3045 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
3046 let qfwinid = (a:cchar == 'c') ? win_getid() : 0
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
3047 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
3048 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
3049
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3050 " Empty quickfix list
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3051 Xexpr ""
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3052 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
3053 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
3054 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
3055 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
3056 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
3057 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
3058 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
3059 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
3060 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
3061
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3062 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
3063 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
3064
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3065 " 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
3066 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
3067 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
3068 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
3069 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
3070 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
3071 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
3072 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
3073 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
3074 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
3075 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
3076 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
3077 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 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
3078 \ '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
3079 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
3080 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
3081 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 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
3082 \ 'changedtick' : 0, 'filewinid' : 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
3083 \ 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
3084 endif
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3085
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3086 " 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
3087 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
3088 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
3089 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
3090 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
3091 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
3092 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
3093 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
3094 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
3095 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
3096 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
3097 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
3098 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 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
3099 \ 'changedtick' : 0}, g:Xgetlist({'nr' : 5, '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
3100 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
3101 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
3102 \ 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 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
3103 \ 'changedtick' : 0, 'filewinid' : 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
3104 \ g:Xgetlist({'nr' : 5, '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
3105 endif
13026
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3106 endfunc
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3107
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3108 func Test_getqflist()
7c0e0e923537 patch 8.0.1389: getqflist() items are missing if not set
Christian Brabandt <cb@256bit.org>
parents: 13016
diff changeset
3109 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
3110 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
3111 endfunc
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3112
13066
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3113 func Test_getqflist_invalid_nr()
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3114 " The following commands used to crash Vim
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3115 cexpr ""
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3116 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
3117
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3118 " Cleanup
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3119 call setqflist([], 'r')
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3120 endfunc
617112037564 patch 8.0.1408: crash in setqflist()
Christian Brabandt <cb@256bit.org>
parents: 13062
diff changeset
3121
13062
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3122 " 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
3123 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
3124 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
3125
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3126 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
3127
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3128 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
3129 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
3130 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
3131 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
3132 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
3133 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
3134 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
3135 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
3136 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
3137 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
3138 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
3139
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3140 enew!
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3141 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
3142 Xaddbuffer
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3143 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
3144 enew!
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3145
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3146 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
3147 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
3148 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
3149 \ {'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
3150 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
3151 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
3152 \ {'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
3153 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
3154 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
3155 \ {'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
3156 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
3157
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3158 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
3159 Xfile Xone
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3160 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
3161 Xaddfile Xone
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3162 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
3163
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3164 " 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
3165 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
3166 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
3167 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
3168 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
3169 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
3170 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
3171
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3172 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
3173 endfunc
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3174
6479dadcf214 patch 8.0.1406: difficult to track changes to a quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13026
diff changeset
3175 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
3176 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
3177 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
3178 endfunc
13074
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3179
14603
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
3180 " 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
3181 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
3182 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
3183 Xhelpgrep Vim@en
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
3184 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
3185 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
3186 new | only
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
3187 endfunc
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
3188
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
3189 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
3190 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
3191 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
3192 endfunc
d1b69129db99 patch 8.1.0315: helpgrep with language doesn't work properly
Christian Brabandt <cb@256bit.org>
parents: 14552
diff changeset
3193
13074
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3194 " 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
3195 " 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
3196 " 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
3197 " 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
3198 func Test_ll_window_ctx()
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3199 call setloclist(0, [], 'f')
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3200 call setloclist(0, [], 'a', {'context' : []})
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3201 lopen | only
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3202 call test_garbagecollect_now()
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3203 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
3204 enew | only
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3205 endfunc
66c014c71dad patch 8.0.1412: using free memory using setloclist()
Christian Brabandt <cb@256bit.org>
parents: 13066
diff changeset
3206
13078
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
3207 " 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
3208 func Test_lfile_crash()
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
3209 sp Xtest
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
3210 au QuickFixCmdPre * bw
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
3211 call assert_fails('lfile', 'E40')
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
3212 au! QuickFixCmdPre
a1f8939a4644 patch 8.0.1414: accessing freed memory in :lfile.
Christian Brabandt <cb@256bit.org>
parents: 13074
diff changeset
3213 endfunc
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3214
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3215 " 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
3216 func Test_lbuffer_crash()
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3217 sv Xtest
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3218 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3219 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3220 au * * bw
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3221 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3222 lbuffer
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3223 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3224 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3225 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3226 endfunc
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3227
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3228 " 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
3229 func Test_lexpr_crash()
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3230 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3231 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3232 au * * call setloclist(0, [], 'f')
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3233 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3234 lexpr ""
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3235 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3236 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3237 augroup END
14954
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3238
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3239 enew | only
14954
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3240 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3241 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3242 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
3243 augroup END
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3244 lexpr 'x:1:x'
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3245 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3246 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3247 augroup END
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3248
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3249 enew | only
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3250 lexpr ''
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3251 lopen
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3252 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3253 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3254 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
3255 augroup END
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3256 lexpr ''
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3257 augroup QF_Test
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3258 au!
69d2749a6a2f patch 8.1.0488: using freed memory in quickfix code
Bram Moolenaar <Bram@vim.org>
parents: 14915
diff changeset
3259 augroup END
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3260 endfunc
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3261
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3262 " 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
3263 func Test_lvimgrep_crash()
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3264 sv Xtest
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3265 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3266 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3267 au * * call setloclist(0, [], 'f')
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3268 augroup END
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3269 lvimgrep quickfix test_quickfix.vim
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3270 augroup QF_Test
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3271 au!
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3272 augroup END
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3273
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3274 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3275 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3276 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3277 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
3278 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3279 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
3280 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3281 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3282 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3283
13090
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3284 enew | only
a0c6910e7fa4 patch 8.0.1420: accessing freed memory in vimgrep
Christian Brabandt <cb@256bit.org>
parents: 13078
diff changeset
3285 endfunc
13105
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3286
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3287 " 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
3288 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
3289 " 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
3290 new | only
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3291 new
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3292 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
3293 copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3294 " 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
3295 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
3296 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3297 " 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
3298 wincmd t
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3299 topleft copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3300 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
3301 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3302 " 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
3303 wincmd t
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3304 below new
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3305 leftabove copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3306 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
3307 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3308 " 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
3309 rightbelow copen
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3310 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
3311 close
bfa7f5b23c53 patch 8.0.1427: the :leftabove modifier doesn't work for :copen
Christian Brabandt <cb@256bit.org>
parents: 13090
diff changeset
3312 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
3313
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
3314 " 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
3315 " :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
3316 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
3317 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
3318 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
3319 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
3320
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
3321 " 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
3322 " 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
3323 " 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
3324 " list.
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
3325 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
3326 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
3327 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
3328 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
3329 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
3330 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
3331
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
3332 " 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
3333 " 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
3334 " 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
3335 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
3336 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
3337 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
3338 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
3339 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
3340
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
3341 " 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
3342 " 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
3343 " 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
3344 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
3345 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
3346 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
3347 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
3348 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
3349
4d55eb79178b patch 8.0.1669: :vimgrep may add entries to the wrong quickfix list
Christian Brabandt <cb@256bit.org>
parents: 13115
diff changeset
3350 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
3351 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
3352 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
3353 endfunc
13756
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3354
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3355 " 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
3356 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
3357 lhelpgrep quickfix
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3358 autocmd QuickFixCmdPost * call setloclist(0, [], 'f')
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3359 lhelpgrep buffer
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3360 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
3361 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
3362 lhelpgrep tabpage
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3363 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
3364 call assert_equal(1, 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
3365 au! QuickFixCmdPost
14956
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3366
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3367 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3368 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3369 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3370 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
3371 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3372 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
3373 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3374 au! BufEnter
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3375 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3376
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3377 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3378 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3379 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3380 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
3381 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3382 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
3383 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3384 au! BufEnter
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3385 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3386
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3387 new | only
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3388 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3389 au!
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3390 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
3391 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3392 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
3393 augroup QF_Test
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3394 au! BufEnter
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3395 augroup END
940def6df43f patch 8.1.0489: crash when autocmd clears vimpgrep location list
Bram Moolenaar <Bram@vim.org>
parents: 14954
diff changeset
3396
13756
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3397 new | only
c38f29387245 patch 8.0.1750: crash when clearing loccation list in autocommand
Christian Brabandt <cb@256bit.org>
parents: 13612
diff changeset
3398 endfunc
13819
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3399
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3400 " 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
3401 " 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
3402 func Test_shorten_fname()
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3403 if !has('unix')
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3404 return
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3405 endif
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3406 %bwipe
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3407 " Create a quickfix list with a absolute path filename
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3408 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
3409 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
3410 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
3411 " 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
3412 cwindow
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3413 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
3414 cclose
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3415 %bwipe
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3416 " Create a quickfix list with a absolute path filename
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3417 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
3418 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
3419 " 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
3420 silent! clist
31bb8e1f7625 patch 8.0.1781: file names in quickfix window are not shortened
Christian Brabandt <cb@256bit.org>
parents: 13764
diff changeset
3421 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
3422 endfunc
13921
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3423
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3424 " 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
3425 " 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
3426 " 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
3427 " 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
3428 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
3429 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
3430
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3431 " :cexpr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3432 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
3433 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
3434
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3435 " :cgetexpr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3436 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
3437 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
3438 \ 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
3439
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3440 " :caddexpr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3441 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
3442 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
3443 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
3444 \ 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
3445
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3446 " :cbuffer
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3447 new Xerr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3448 exe "cbuffer"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3449 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
3450
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3451 " :cgetbuffer
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3452 edit Xerr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3453 exe "cgetbuffer"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3454 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
3455
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3456 " :caddbuffer
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3457 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
3458 edit Xerr
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3459 exe "caddbuffer"
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3460 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
3461
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3462 " :cfile
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3463 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
3464 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
3465
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3466 " :cgetfile
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3467 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
3468 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
3469
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3470 " :caddfile
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3471 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
3472 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
3473 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
3474
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3475 " :grep
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3476 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
3477 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
3478 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
3479
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3480 " :grepadd
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3481 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
3482 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
3483 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
3484 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
3485
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3486 " :vimgrep
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3487 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
3488 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
3489
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3490 " :vimgrepadd
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3491 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
3492 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
3493 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
3494
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3495 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
3496 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
3497
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3498 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
3499 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
3500 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
3501
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3502 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
3503 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
3504 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
3505
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3506 close
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3507 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
3508
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3509 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
3510 copen
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3511 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
3512 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
3513 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
3514 cclose
3b6c29f8c1a2 patch 8.0.1831: sometimes the quickfix title is incorrectly prefixed with ':'
Christian Brabandt <cb@256bit.org>
parents: 13825
diff changeset
3515 endfunc
14085
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3516
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3517 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
3518 new
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3519 new
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3520 augroup nasty
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3521 au * * bwipe
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3522 augroup END
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3523 lbuffer
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3524 augroup nasty
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3525 au!
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3526 augroup END
59e76d550c10 patch 8.1.0060: crash when autocommands delete the current buffer
Christian Brabandt <cb@256bit.org>
parents: 13948
diff changeset
3527 endfunc
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3528
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3529 " 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
3530 " running
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3531 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
3532 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
3533
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3534 " This was using freed memory.
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3535 augroup nasty
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3536 au * * call g:Xsetlist([], 'f')
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3537 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
3538 Xexpr "x"
14111
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3539 augroup nasty
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3540 au!
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3541 augroup END
678e326bf7eb patch 8.1.0073: crash when autocommands call setloclist()
Christian Brabandt <cb@256bit.org>
parents: 14085
diff changeset
3542 endfunc
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3543
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3544 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
3545 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
3546 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
3547 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3548
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3549 " 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
3550 " 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
3551 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
3552 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
3553
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3554 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
3555 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
3556 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
3557
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3558 " 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
3559 enew
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3560 Xexpr l
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3561 call assert_equal('Xtestfile1', bufname(''))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3562 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
3563
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3564 " 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
3565 enew
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3566 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
3567 Xfile Xerr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3568 call assert_equal('Xtestfile1', bufname(''))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3569 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
3570
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3571 " 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
3572 edit Xerr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3573 Xbuffer
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3574 call assert_equal('Xtestfile1', bufname(''))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3575 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
3576
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3577 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
3578 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
3579 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
3580 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3581
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3582 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
3583 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
3584 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
3585 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3586
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3587 " 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
3588 " 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
3589 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
3590 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
3591
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3592 " 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
3593 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
3594 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
3595 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
3596 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
3597 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
3598 Xfile Xerr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3599 call assert_equal('Xtestfile2', bufname(''))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3600 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
3601 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3602
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3603 " 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
3604 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
3605 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
3606 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
3607 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
3608 edit Xerr
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3609 Xbuffer
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3610 call assert_equal('Xtestfile2', bufname(''))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3611 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
3612 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3613
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3614 " 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
3615 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
3616 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
3617 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
3618 Xexpr '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
3619 call assert_equal('Xtestfile2', bufname(''))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3620 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
3621 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3622
14258
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
3623 " 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
3624 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
3625 " 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
3626 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
3627 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
3628 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
3629 silent Xgrep Line5 Xtestfile2
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
3630 call assert_equal('Xtestfile2', bufname(''))
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
3631 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
3632 autocmd! QuickFixCmdPost
71bb93bf9a44 patch 8.1.0145: test with grep is failing on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 14250
diff changeset
3633 endif
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3634
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3635 " 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
3636 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
3637 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
3638 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
3639 silent Xvimgrep Line5 Xtestfile2
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3640 call assert_equal('Xtestfile2', bufname(''))
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3641 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
3642 autocmd! QuickFixCmdPost
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3643
14491
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3644 " 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
3645 " 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
3646 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
3647 let v:errmsg = ''
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3648 " Test for cfile/lfile
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3649 Xfile Xerr
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3650 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
3651 " Test for cbuffer/lbuffer
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3652 edit Xerr
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3653 Xbuffer
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3654 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
3655 " Test for cexpr/lexpr
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3656 Xexpr 'Xtestfile2:4:Line4'
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3657 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
3658 " Test for grep/lgrep
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3659 " 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
3660 if has('unix')
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3661 silent Xgrep Line5 Xtestfile2
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3662 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
3663 endif
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3664 " Test for vimgrep/lvimgrep
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3665 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
3666 autocmd! QuickFixCmdPost
9df0fcbfebb2 patch 8.1.0259: no test for fixed quickfix issue
Christian Brabandt <cb@256bit.org>
parents: 14397
diff changeset
3667
14250
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3668 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
3669 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
3670 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
3671 endfunc
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3672
ca6ccee4823f patch 8.1.0141: :cexpr no longer jumps to the first error
Christian Brabandt <cb@256bit.org>
parents: 14111
diff changeset
3673 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
3674 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
3675 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
3676 endfunc
14299
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
3677
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
3678 " 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
3679 func Test_filter_clist()
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
3680 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
3681 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
3682 \ 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
3683 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
3684 \ 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
3685 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
3686
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
3687 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
3688 \ {'module' : 'pqr', 'pattern' : 'pat2'}], ' ')
932dde1d8a71 patch 8.1.0165: :clist output can be very long
Christian Brabandt <cb@256bit.org>
parents: 14258
diff changeset
3689 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
3690 \ 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
3691 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
3692 \ 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
3693 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
3694
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
3695 " 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
3696 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
3697 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
3698
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
3699 " 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
3700 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
3701 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
3702 let 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
3703 call assert_fails('execute "normal! \<C-W>\<CR>"', 'E42')
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
3704 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
3705 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
3706 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
3707
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
3708 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
3709 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
3710 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
3711 endfunc
14552
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
3712
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
3713 " 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
3714 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
3715 helpgrep quickfix
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
3716 normal! llll
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
3717 1cc
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
3718 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
3719 cclose | helpclose
b298737a7188 patch 8.1.0289: cursor moves to wrong column after quickfix jump
Christian Brabandt <cb@256bit.org>
parents: 14491
diff changeset
3720 endfunc