diff options
author | lonerover <pathfinder1644@yahoo.com> | 2017-01-17 15:36:00 +0800 |
---|---|---|
committer | lonerover <pathfinder1644@yahoo.com> | 2017-01-19 10:11:53 +0800 |
commit | 1a06a3948861b11a9bae0b044f0342fc2190584d (patch) | |
tree | 9bce1f43e4cf4ff3d25604d008377e504e765477 /src/nvim/testdir/test_quickfix.vim | |
parent | d3b4764dc137e0f6f2c219244e00fba92a64a384 (diff) | |
download | rneovim-1a06a3948861b11a9bae0b044f0342fc2190584d.tar.gz rneovim-1a06a3948861b11a9bae0b044f0342fc2190584d.tar.bz2 rneovim-1a06a3948861b11a9bae0b044f0342fc2190584d.zip |
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
Diffstat (limited to 'src/nvim/testdir/test_quickfix.vim')
-rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 24 |
1 files changed, 24 insertions, 0 deletions
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 |