From 1a06a3948861b11a9bae0b044f0342fc2190584d Mon Sep 17 00:00:00 2001 From: lonerover Date: Tue, 17 Jan 2017 15:36:00 +0800 Subject: vim-patch:7.4.2049 Problem: There is no way to get a list of the error lists. Solution: Add ":chistory" and ":lhistory". https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954 --- src/nvim/testdir/test_quickfix.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/nvim/testdir/test_quickfix.vim') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index f30902b915..17f0bde6d3 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1420,3 +1420,27 @@ function Test_cbottom() call XbottomTests('c') call XbottomTests('l') endfunction + +function HistoryTest(cchar) + call s:setup_commands(a:cchar) + + call assert_fails(a:cchar . 'older 99', 'E380:') + " clear all lists after the first one, then replace the first one. + call g:Xsetlist([]) + Xolder + let entry = {'filename': 'foo', 'lnum': 42} + call g:Xsetlist([entry], 'r') + call g:Xsetlist([entry, entry]) + call g:Xsetlist([entry, entry, entry]) + let res = split(execute(a:cchar . 'hist'), "\n") + call assert_equal(3, len(res)) + let common = 'errors :set' . (a:cchar == 'c' ? 'qf' : 'loc') . 'list()' + call assert_equal(' error list 1 of 3; 1 ' . common, res[0]) + call assert_equal(' error list 2 of 3; 2 ' . common, res[1]) + call assert_equal('> error list 3 of 3; 3 ' . common, res[2]) +endfunc + +func Test_history() + call HistoryTest('c') + call HistoryTest('l') +endfunc -- cgit