From 4a6e201e37a9b08860cb823c528ea062002b7ebc Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 7 Oct 2020 01:00:11 -0400 Subject: vim-patch:8.1.1705: using ~{} for a literal dict is not nice Problem: Using ~{} for a literal dict is not nice. Solution: Use #{} instead. https://github.com/vim/vim/commit/4c6d90458baae843463f930fdc3fe4a7a2191d27 --- src/nvim/eval.c | 6 +++--- src/nvim/testdir/test_listdict.vim | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a4594d9ac8..a2490be355 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -3906,7 +3906,7 @@ static int eval6(char_u **arg, typval_T *rettv, int evaluate, int want_string) // (expression) nested expression // [expr, expr] List // {key: val, key: val} Dictionary -// ~{key: val, key: val} Dictionary with literal keys +// #{key: val, key: val} Dictionary with literal keys // // Also handle: // ! in front logical NOT @@ -4014,8 +4014,8 @@ static int eval7( case '[': ret = get_list_tv(arg, rettv, evaluate); break; - // Dictionary: ~{key: val, key: val} - case '~': + // Dictionary: #{key: val, key: val} + case '#': if ((*arg)[1] == '{') { (*arg)++; ret = dict_get_tv(arg, rettv, evaluate, true); diff --git a/src/nvim/testdir/test_listdict.vim b/src/nvim/testdir/test_listdict.vim index 28cbceef9a..31a8b48d37 100644 --- a/src/nvim/testdir/test_listdict.vim +++ b/src/nvim/testdir/test_listdict.vim @@ -281,7 +281,7 @@ func Test_dict_func_remove_in_use() endfunc func Test_dict_literal_keys() - call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, ~{one: 1, two2: 2, 3three: 3, 44: 4},) + call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, #{one: 1, two2: 2, 3three: 3, 44: 4},) " why *{} cannot be used let blue = 'blue' -- cgit