diff options
author | Tom Praschan <13141438+tom-anders@users.noreply.github.com> | 2023-08-11 23:26:12 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-11 23:26:12 +0200 |
commit | ca6ac99077d2e6d020a34267aa5e0fbc4d23dc38 (patch) | |
tree | e45ca226cd32378ba5d4b4a1565d15f163ae461b /src/testdir/test_quickfix.vim | |
parent | 7e0bae024d4c1673cff31763227ad52b936fa56f (diff) |
patch 9.0.1688: cannot store custom data in quickfix listv9.0.1688
Problem: cannot store custom data in quickfix list
Solution: add `user_data` field for the quickfix list
closes: #11818
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
Diffstat (limited to 'src/testdir/test_quickfix.vim')
-rw-r--r-- | src/testdir/test_quickfix.vim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index b7d290275b..33ce700f0b 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1808,13 +1808,23 @@ func SetXlistTests(cchar, bnum) call s:setup_commands(a:cchar) call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 1}, - \ {'bufnr': a:bnum, 'lnum': 2, 'end_lnum': 3, 'col': 4, 'end_col': 5}]) + \ {'bufnr': a:bnum, 'lnum': 2, 'end_lnum': 3, 'col': 4, 'end_col': 5, 'user_data': {'6': [7, 8]}}]) let l = g:Xgetlist() call assert_equal(2, len(l)) call assert_equal(2, l[1].lnum) call assert_equal(3, l[1].end_lnum) call assert_equal(4, l[1].col) call assert_equal(5, l[1].end_col) + call assert_equal({'6': [7, 8]}, l[1].user_data) + + " Test that user_data is garbage collected + call g:Xsetlist([{'user_data': ['high', 5]}, + \ {'user_data': {'this': [7, 'eight'], 'is': ['a', 'dictionary']}}]) + call test_garbagecollect_now() + let l = g:Xgetlist() + call assert_equal(2, len(l)) + call assert_equal(['high', 5], l[0].user_data) + call assert_equal({'this': [7, 'eight'], 'is': ['a', 'dictionary']}, l[1].user_data) Xnext call g:Xsetlist([{'bufnr': a:bnum, 'lnum': 3}], 'a') |