Mercurial > vim
diff src/testdir/test_expr.vim @ 9770:ba98d7ce0d74 v7.4.2160
commit https://github.com/vim/vim/commit/7dc5e2e486fe0287601968e535902a41a39f65bb
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 5 22:22:06 2016 +0200
patch 7.4.2160
Problem: setmatches() mixes up values. (Nikolai Pavlov)
Solution: Save the string instead of reusing a shared buffer.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Aug 2016 22:30:07 +0200 |
parents | 80ac9cf77c9b |
children | 560291211303 |
line wrap: on
line diff
--- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -194,3 +194,12 @@ func Test_funcref() let OneByRef = funcref('One') call assert_equal(2, OneByRef()) endfunc + +func Test_setmatches() + hi def link 1 Comment + hi def link 2 PreProc + let set = [{"group": 1, "pattern": 2, "id": 3, "priority": 4, "conceal": 5}] + let exp = [{"group": '1', "pattern": '2', "id": 3, "priority": 4, "conceal": '5'}] + call setmatches(set) + call assert_equal(exp, getmatches()) +endfunc