comparison src/testdir/test_quickfix.vim @ 23045:450d6e4992e1 v8.2.2069

patch 8.2.2069: the quickfix window is not updated after setqflist() Commit: https://github.com/vim/vim/commit/287153c5d481a09ffe98a95ad78390ff580bb557 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 29 14:20:27 2020 +0100 patch 8.2.2069: the quickfix window is not updated after setqflist() Problem: The quickfix window is not updated after setqflist(). Solution: Update the quickfix buffer. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/7390, closes #7385)
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 Nov 2020 14:30:04 +0100
parents fab8455af19c
children c713358da074
comparison
equal deleted inserted replaced
23044:6d22f8380f7f 23045:450d6e4992e1
5251 call StopVimInTerminal(buf) 5251 call StopVimInTerminal(buf)
5252 call delete('XtestWinFails') 5252 call delete('XtestWinFails')
5253 call delete('XquickfixFails') 5253 call delete('XquickfixFails')
5254 endfunc 5254 endfunc
5255 5255
5256 " Test for updating the quickfix buffer whenever the assocaited quickfix list
5257 " is changed.
5258 func Xqfbuf_update(cchar)
5259 call s:setup_commands(a:cchar)
5260
5261 Xexpr "F1:1:line1"
5262 Xopen
5263 call assert_equal(['F1|1| line1'], getline(1, '$'))
5264 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
5265
5266 " Test setqflist() using the 'lines' key in 'what'
5267 " add a new entry
5268 call g:Xsetlist([], 'a', {'lines' : ['F2:2: line2']})
5269 call assert_equal(['F1|1| line1', 'F2|2| line2'], getline(1, '$'))
5270 call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
5271 " replace all the entries with a single entry
5272 call g:Xsetlist([], 'r', {'lines' : ['F3:3: line3']})
5273 call assert_equal(['F3|3| line3'], getline(1, '$'))
5274 call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
5275 " remove all the entries
5276 call g:Xsetlist([], 'r', {'lines' : []})
5277 call assert_equal([''], getline(1, '$'))
5278 call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
5279 " add a new list
5280 call g:Xsetlist([], ' ', {'lines' : ['F4:4: line4']})
5281 call assert_equal(['F4|4| line4'], getline(1, '$'))
5282 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
5283
5284 " Test setqflist() using the 'items' key in 'what'
5285 " add a new entry
5286 call g:Xsetlist([], 'a', {'items' : [{'filename' : 'F5', 'lnum' : 5, 'text' : 'line5'}]})
5287 call assert_equal(['F4|4| line4', 'F5|5| line5'], getline(1, '$'))
5288 call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
5289 " replace all the entries with a single entry
5290 call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F6', 'lnum' : 6, 'text' : 'line6'}]})
5291 call assert_equal(['F6|6| line6'], getline(1, '$'))
5292 call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
5293 " remove all the entries
5294 call g:Xsetlist([], 'r', {'items' : []})
5295 call assert_equal([''], getline(1, '$'))
5296 call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
5297 " add a new list
5298 call g:Xsetlist([], ' ', {'items' : [{'filename' : 'F7', 'lnum' : 7, 'text' : 'line7'}]})
5299 call assert_equal(['F7|7| line7'], getline(1, '$'))
5300 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
5301
5302 call g:Xsetlist([], ' ', {})
5303 call assert_equal([''], getline(1, '$'))
5304 call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
5305
5306 Xclose
5307 endfunc
5308
5309 func Test_qfbuf_update()
5310 call Xqfbuf_update('c')
5311 call Xqfbuf_update('l')
5312 endfunc
5313
5256 " vim: shiftwidth=2 sts=2 expandtab 5314 " vim: shiftwidth=2 sts=2 expandtab