|
1 |
| -*vim9.txt* For Vim version 9.0. Last change: 2023 Mar 07 |
| 1 | +*vim9.txt* For Vim version 9.0. Last change: 2023 Jun 10 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -117,6 +117,9 @@ script and `:def` functions; details are below:
|
117 | 117 | - Unless mentioned specifically, the highest |scriptversion| is used.
|
118 | 118 | - When defining an expression mapping, the expression will be evaluated in the
|
119 | 119 | context of the script where it was defined.
|
| 120 | +- When indexing a string the index is counted in characters, not bytes: |
| 121 | + |vim9-string-index| |
| 122 | +- Some possibly unexpected differences: |vim9-gotchas|. |
120 | 123 |
|
121 | 124 |
|
122 | 125 | Comments starting with # ~
|
@@ -190,8 +193,8 @@ created yet. In this case you can call `execute()` to invoke it at runtime. >
|
190 | 193 | used for the command or the error was caught a `:try` block), does not get a
|
191 | 194 | range passed, cannot be a "dict" function, and can always be a closure.
|
192 | 195 | *vim9-no-dict-function*
|
193 |
| -Later classes will be added, which replaces the "dict function" mechanism. |
194 |
| -For now you will need to pass the dictionary explicitly: > |
| 196 | +You can use a Vim9 Class (|Vim9-class|) instead of a "dict function". |
| 197 | +You can also pass the dictionary explicitly: > |
195 | 198 | def DictFunc(self: dict<any>, arg: string)
|
196 | 199 | echo self[arg]
|
197 | 200 | enddef
|
@@ -1056,11 +1059,11 @@ It is possible to compare `null` with any value, this will not give a type
|
1056 | 1059 | error. However, comparing `null` with a number, float or bool will always
|
1057 | 1060 | result in `false`. This is different from legacy script, where comparing
|
1058 | 1061 | `null` with zero or `false` would return `true`.
|
1059 |
| - |
| 1062 | + *vim9-false-true* |
1060 | 1063 | When converting a boolean to a string `false` and `true` are used, not
|
1061 | 1064 | `v:false` and `v:true` like in legacy script. `v:none` has no `none`
|
1062 | 1065 | replacement, it has no equivalent in other languages.
|
1063 |
| - |
| 1066 | + *vim9-string-index* |
1064 | 1067 | Indexing a string with [idx] or taking a slice with [idx : idx] uses character
|
1065 | 1068 | indexes instead of byte indexes. Composing characters are included.
|
1066 | 1069 | Example: >
|
|
0 commit comments