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') 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 From 827f2f9f6b75ba182d27c30a6a056968bed65eaa Mon Sep 17 00:00:00 2001 From: lonerover Date: Tue, 17 Jan 2017 16:33:53 +0800 Subject: vim-patch:7.4.2050 Problem: When using ":vimgrep" may end up with duplicate buffers. Solution: When adding an error list entry pass the buffer number if possible. https://github.com/vim/vim/commit/015102e91e978a0bb42a14461c132a85e8f7e1ea --- src/nvim/testdir/test_quickfix.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 17f0bde6d3..008cc6c11b 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1444,3 +1444,18 @@ func Test_history() call HistoryTest('c') call HistoryTest('l') endfunc + +func Test_duplicate_buf() + " make sure we can get the highest buffer number + edit DoesNotExist + edit DoesNotExist2 + let last_buffer = bufnr("$") + + " make sure only one buffer is created + call writefile(['this one', 'that one'], 'Xgrepthis') + vimgrep one Xgrepthis + vimgrep one Xgrepthis + call assert_equal(last_buffer + 1, bufnr("$")) + + call delete('Xgrepthis') +endfunc -- cgit From 0060974b2bdd28edf9d34a53daa7862ce55b1f43 Mon Sep 17 00:00:00 2001 From: lonerover Date: Wed, 18 Jan 2017 12:13:51 +0800 Subject: vim-patch:7.4.2081 Problem: Line numbers in the error list are not always adjusted. Solution: Set b_has_qf_entry properly. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/c1542744e788d96fed24dd421f43009288092504 --- src/nvim/testdir/test_quickfix.vim | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 008cc6c11b..7464a11abd 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1299,13 +1299,14 @@ function! Xadjust_qflnum(cchar) enew | only - call s:create_test_file('Xqftestfile') - edit Xqftestfile + let fname = 'Xqftestfile' . a:cchar + call s:create_test_file(fname) + exe 'edit ' . fname - Xgetexpr ['Xqftestfile:5:Line5', - \ 'Xqftestfile:10:Line10', - \ 'Xqftestfile:15:Line15', - \ 'Xqftestfile:20:Line20'] + Xgetexpr [fname . ':5:Line5', + \ fname . ':10:Line10', + \ fname . ':15:Line15', + \ fname . ':20:Line20'] 6,14delete call append(6, ['Buffer', 'Window']) @@ -1317,11 +1318,13 @@ function! Xadjust_qflnum(cchar) call assert_equal(13, l[3].lnum) enew! - call delete('Xqftestfile') + call delete(fname) endfunction function! Test_adjust_lnum() + call setloclist(0, []) call Xadjust_qflnum('c') + call setqflist([]) call Xadjust_qflnum('l') endfunction -- cgit