Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 11502:46bbef0ee9a6 v8.0.0634
patch 8.0.0634: cannot easily get to the last quickfix list
commit https://github.com/vim/vim/commit/875feea6ce223462d55543735143d747dcaf4287
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 11 16:07:51 2017 +0200
patch 8.0.0634: cannot easily get to the last quickfix list
Problem: Cannot easily get to the last quickfix list.
Solution: Add "$" as a value for the "nr" argument of getqflist() and
setqflist(). (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 11 Jun 2017 16:15:04 +0200 |
parents | 461ac47c3793 |
children | f5add45f9848 |
comparison
equal
deleted
inserted
replaced
11501:2ac2ec9f4160 | 11502:46bbef0ee9a6 |
---|---|
1648 " Calling lbottom without any errors should fail | 1648 " Calling lbottom without any errors should fail |
1649 if a:cchar == 'l' | 1649 if a:cchar == 'l' |
1650 call assert_fails('lbottom', 'E776:') | 1650 call assert_fails('lbottom', 'E776:') |
1651 endif | 1651 endif |
1652 | 1652 |
1653 call g:Xsetlist([{'filename': 'foo', 'lnum': 42}]) | 1653 call g:Xsetlist([{'filename': 'foo', 'lnum': 42}]) |
1654 Xopen | 1654 Xopen |
1655 let wid = win_getid() | 1655 let wid = win_getid() |
1656 call assert_equal(1, line('.')) | 1656 call assert_equal(1, line('.')) |
1657 wincmd w | 1657 wincmd w |
1658 call g:Xsetlist([{'filename': 'var', 'lnum': 24}], 'a') | 1658 call g:Xsetlist([{'filename': 'var', 'lnum': 24}], 'a') |
1659 Xbottom | 1659 Xbottom |
1660 call win_gotoid(wid) | 1660 call win_gotoid(wid) |
1661 call assert_equal(2, line('.')) | 1661 call assert_equal(2, line('.')) |
1662 Xclose | 1662 Xclose |
1663 endfunc | 1663 endfunc |
2118 cgetexpr ['Entering directory ' . repeat('a', 1006), | 2118 cgetexpr ['Entering directory ' . repeat('a', 1006), |
2119 \ 'File1:10:Hello World'] | 2119 \ 'File1:10:Hello World'] |
2120 set efm&vim | 2120 set efm&vim |
2121 endfunc | 2121 endfunc |
2122 | 2122 |
2123 func Test_cclose_from_copen() | |
2124 augroup QF_Test | |
2125 au! | |
2126 au FileType qf :cclose | |
2127 augroup END | |
2128 copen | |
2129 augroup QF_Test | |
2130 au! | |
2131 augroup END | |
2132 augroup! QF_Test | |
2133 endfunc | |
2134 | |
2135 " Tests for getting the quickfix stack size | |
2136 func XsizeTests(cchar) | |
2137 call s:setup_commands(a:cchar) | |
2138 | |
2139 call g:Xsetlist([], 'f') | |
2140 call assert_equal(0, g:Xgetlist({'nr':'$'}).nr) | |
2141 call assert_equal(1, len(g:Xgetlist({'nr':'$', 'all':1}))) | |
2142 call assert_equal(0, len(g:Xgetlist({'nr':0}))) | |
2143 | |
2144 Xexpr "File1:10:Line1" | |
2145 Xexpr "File2:20:Line2" | |
2146 Xexpr "File3:30:Line3" | |
2147 Xolder | Xolder | |
2148 call assert_equal(3, g:Xgetlist({'nr':'$'}).nr) | |
2149 call g:Xsetlist([], 'f') | |
2150 | |
2151 Xexpr "File1:10:Line1" | |
2152 Xexpr "File2:20:Line2" | |
2153 Xexpr "File3:30:Line3" | |
2154 Xolder | Xolder | |
2155 call g:Xsetlist([], 'a', {'nr':'$', 'title':'Compiler'}) | |
2156 call assert_equal('Compiler', g:Xgetlist({'nr':3, 'all':1}).title) | |
2157 endfunc | |
2158 | |
2159 func Test_Qf_Size() | |
2160 call XsizeTests('c') | |
2161 call XsizeTests('l') | |
2162 endfunc |