diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-12 08:19:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-12 08:19:06 +0800 |
commit | 6c07a189f2d10a533af8a51819ea96c45e0c567e (patch) | |
tree | ac42f73a102aea44e926b70b5c6d4f8fb3664634 /test | |
parent | 72cf94fc0e69b7a049ae2990572876d641cf5cb9 (diff) | |
download | rneovim-6c07a189f2d10a533af8a51819ea96c45e0c567e.tar.gz rneovim-6c07a189f2d10a533af8a51819ea96c45e0c567e.tar.bz2 rneovim-6c07a189f2d10a533af8a51819ea96c45e0c567e.zip |
vim-patch:9.0.1688: cannot store custom data in quickfix list (#24673)
Problem: cannot store custom data in quickfix list
Solution: add `user_data` field for the quickfix list
closes: vim/vim#11818
https://github.com/vim/vim/commit/ca6ac99077d2e6d020a34267aa5e0fbc4d23dc38
Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_quickfix.vim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/old/testdir/test_quickfix.vim b/test/old/testdir/test_quickfix.vim index 6378ee8770..e61da49584 100644 --- a/test/old/testdir/test_quickfix.vim +++ b/test/old/testdir/test_quickfix.vim @@ -1649,13 +1649,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') |