diff options
| author | James McCoy <jamessan@jamessan.com> | 2016-12-12 15:05:01 -0500 |
|---|---|---|
| committer | James McCoy <jamessan@jamessan.com> | 2016-12-27 14:10:26 -0500 |
| commit | 9df9cf4ecc4143ce23b5ab85b2ad1ef413a249bd (patch) | |
| tree | 92c1e8db99c1339cd716241702d1d440362d398d /src/nvim/testdir | |
| parent | e2b081ed0c9aa43e891e5b33c1f3f077bc579356 (diff) | |
| download | rneovim-9df9cf4ecc4143ce23b5ab85b2ad1ef413a249bd.tar.gz rneovim-9df9cf4ecc4143ce23b5ab85b2ad1ef413a249bd.tar.bz2 rneovim-9df9cf4ecc4143ce23b5ab85b2ad1ef413a249bd.zip | |
vim-patch:7.4.1841
Problem: The code to reallocate the buffer used for quickfix is repeated.
Solution: Move the code to a function. (Yegappan Lakshmanan, closes vim/vim#831)
https://github.com/vim/vim/commit/2b2b8ae5ab37b04584633c469265d85825166905
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index d43ab1e6db..73ee240c77 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -682,14 +682,14 @@ endfunc " Tests for the setqflist() and setloclist() functions function SetXlistTests(cchar, bnum) + let Xwindow = a:cchar . 'window' + let Xnext = a:cchar . 'next' if a:cchar == 'c' let Xsetlist = function('setqflist') let Xgetlist = function('getqflist') - let Xnext = 'cnext' else let Xsetlist = function('setloclist', [0]) let Xgetlist = function('getloclist', [0]) - let Xnext = 'lnext' endif call Xsetlist([{'bufnr': a:bnum, 'lnum': 1}, @@ -705,6 +705,15 @@ function SetXlistTests(cchar, bnum) exe Xnext call assert_equal(3, line('.')) + " Appending entries to the list should not change the cursor position + " in the quickfix window + exe Xwindow + 1 + call Xsetlist([{'bufnr': a:bnum, 'lnum': 4}, + \ {'bufnr': a:bnum, 'lnum': 5}], 'a') + call assert_equal(1, line('.')) + close + call Xsetlist([{'bufnr': a:bnum, 'lnum': 3}, \ {'bufnr': a:bnum, 'lnum': 4}, \ {'bufnr': a:bnum, 'lnum': 5}], 'r') |