diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-07 00:03:12 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-07 00:36:48 -0400 |
| commit | 7ca5dc2519018c33def6bd6361d26099df04e7e2 (patch) | |
| tree | 45f40d75baa2b2d18e645692616f4e71e3349b11 /runtime | |
| parent | fa1e740e60989134d5e6d623d687c1fd7c57909c (diff) | |
| download | rneovim-7ca5dc2519018c33def6bd6361d26099df04e7e2.tar.gz rneovim-7ca5dc2519018c33def6bd6361d26099df04e7e2.tar.bz2 rneovim-7ca5dc2519018c33def6bd6361d26099df04e7e2.zip | |
vim-patch:8.1.1683: dictionary with string keys is longer than needed
Problem: Dictionary with string keys is longer than needed.
Solution: Use *{key: val} for literaly keys.
https://github.com/vim/vim/commit/d5abb4c87727eecb71b0e8ffdda60fc9598272f3
Vim's popup,textprop features are N/A.
Neovim has not polyfilled their APIs.
Skip docs and tests for these features.
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/doc/eval.txt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5127a9f390..e8c9233a1a 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -38,7 +38,9 @@ List An ordered sequence of items |List|. Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| - Example: {'blue': "#0000ff", 'red': "#ff0000"} + Examples: + {'blue': "#0000ff", 'red': "#ff0000"} + *{blue: "#0000ff", red: "#ff0000"} The Number and String types are converted automatically, depending on how they are used. @@ -436,8 +438,14 @@ only appear once. Examples: > A key is always a String. You can use a Number, it will be converted to a String automatically. Thus the String '4' and the number 4 will find the same entry. Note that the String '04' and the Number 04 are different, since the -Number will be converted to the String '4'. The empty string can be used as a -key. +Number will be converted to the String '4'. The empty string can also be used +as a key. + *literal-Dict* +To avoid having to put quotes around every key the *{} form can be used. This +does require the key to consist only of ASCII letters, digits, '-' and '_'. +Example: > + let mydict = *{zero: 0, one_key: 1, two-key: 2, 333: 3} +Note that 333 here is the string "333". Empty keys are not possible here. A value can be any expression. Using a Dictionary for a value creates a nested Dictionary: > |