From b8be54dcc517c9d57b62409945b7d4b90b6c3071 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 14 Jul 2019 18:22:59 +0200 Subject: patch 8.1.1692: using *{} for literal dict is not backwards compatible Problem: Using *{} for literal dict is not backwards compatible. (Yasuhiro Matsumoto) Solution: Use ~{} instead. --- runtime/doc/eval.txt | 6 +++--- runtime/doc/popup.txt | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1944fdd869..b100682385 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -60,7 +60,7 @@ Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| Examples: {'blue': "#0000ff", 'red': "#ff0000"} - *{blue: "#0000ff", red: "#ff0000"} + ~{blue: "#0000ff", red: "#ff0000"} Funcref A reference to a function |Funcref|. Example: function("strlen") @@ -482,10 +482,10 @@ 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 also be used as a key. *literal-Dict* -To avoid having to put quotes around every key the *{} form can be used. This +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} + 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 diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt index 0fd30ebfbe..564bcbe4a4 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -178,7 +178,7 @@ DETAILS *popup-function-details* popup_atcursor({what}, {options}) *popup_atcursor()* Show the {what} above the cursor, and close it when the cursor moves. This works like: > - call popup_create({what}, *{ + call popup_create({what}, ~{ \ pos: 'botleft', \ line: 'cursor-1', \ col: 'cursor', @@ -191,7 +191,7 @@ popup_beval({what}, {options}) *popup_beval()* Show the {what} above the position from 'ballooneval' and close it when the mouse moves. This works like: > let pos = screenpos(v:beval_winnr, v:beval_lnum, v:beval_col) - call popup_create({what}, *{ + call popup_create({what}, ~{ \ pos: 'botleft', \ line: pos.row - 1, \ col: pos.col, @@ -240,7 +240,7 @@ popup_create({what}, {options}) *popup_create()* popup_dialog({what}, {options}) *popup_dialog()* Just like |popup_create()| but with these default options: > - call popup_create({what}, *{ + call popup_create({what}, ~{ \ pos: 'center', \ zindex: 200, \ drag: 1, @@ -249,7 +249,7 @@ popup_dialog({what}, {options}) *popup_dialog()* \}) < Use {options} to change the properties. E.g. add a 'filter' option with value 'popup_filter_yesno'. Example: > - call popup_create('do you want to quit (Yes/no)?', *{ + call popup_create('do you want to quit (Yes/no)?', ~{ \ filter: 'popup_filter_yesno', \ callback: 'QuitCallback', \ }) @@ -356,7 +356,7 @@ popup_menu({what}, {options}) *popup_menu()* items with cursorkeys, and close it an item is selected with Space or Enter. {what} should have multiple lines to make this useful. This works like: > - call popup_create({what}, *{ + call popup_create({what}, ~{ \ pos: 'center', \ zindex: 200, \ drag: 1, @@ -391,7 +391,7 @@ popup_move({id}, {options}) *popup_move()* popup_notification({what}, {options}) *popup_notification()* Show the {what} for 3 seconds at the top of the Vim window. This works like: > - call popup_create({what}, *{ + call popup_create({what}, ~{ \ line: 1, \ col: 10, \ minwidth: 20, @@ -732,7 +732,7 @@ Prompt the user to press y/Y or n/N: > endif endfunc - call popup_dialog('Continue? y/n', *{ + call popup_dialog('Continue? y/n', ~{ \ filter: 'popup_filter_yesno', \ callback: 'MyDialogHandler', \ }) @@ -740,7 +740,7 @@ Prompt the user to press y/Y or n/N: > *popup_menu-shortcut-example* Extend popup_filter_menu() with shortcut keys: > - call popup_menu(['Save', 'Cancel', 'Discard'], *{ + call popup_menu(['Save', 'Cancel', 'Discard'], ~{ \ filter: 'MyMenuFilter', \ callback: 'MyMenuHandler', \ }) @@ -781,7 +781,7 @@ Example for using a popup window for 'ballooneval': > endif call popup_close(s:winid) endif - let s:winid = popup_beval(v:beval_text, *{mousemoved: 'word'}) + let s:winid = popup_beval(v:beval_text, ~{mousemoved: 'word'}) let s:last_text = v:beval_text return '' endfunc @@ -812,7 +812,7 @@ this example simulated with a timer callback: > endfunc func ShowPopup(id) - let s:winid = popup_beval(s:balloonText, *{mousemoved: 'word'}) + let s:winid = popup_beval(s:balloonText, ~{mousemoved: 'word'}) endfunc < -- cgit v1.2.3