Skip to content

Commit d3ee6b6

Browse files
committed
Update vim9.{txt,jax}
1 parent b82c184 commit d3ee6b6

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

doc/vim9.jax

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,10 +1040,12 @@ Vim9 script では以下の定義済みの値が使えます: >
10401040
null
10411041
null_blob
10421042
null_channel
1043+
null_class
10431044
null_dict
10441045
null_function
10451046
null_job
10461047
null_list
1048+
null_object
10471049
null_partial
10481050
null_string
10491051
`true``v:true` と同じ、`false``v:false` と同じ、そして`null`
@@ -1755,7 +1757,7 @@ Export ~
17551757
export interface MyClass ...
17561758
< *E1043* *E1044*
17571759
このことからわかるように、定数、変数、`:def` 関数、クラスのみが export 可能で
1758-
す。 {not implemented yet: class, interface}
1760+
す。
17591761

17601762
*E1042*
17611763
`:export` はスクリプトレベルで、Vim9 script でのみ使用できます。
@@ -1788,10 +1790,10 @@ export された項目は、別のスクリプトで import することがで
17881790
< *E1060* *E1258* *E1259* *E1260*
17891791
"that.item" 等として使えます。"that" という名称は自由です。import したスクリプ
17901792
トを指していると認識されるようなものを使ってください。コマンド名、コマンド修飾
1791-
語、組み込み関数名などは避けてください。名前がそれら被るからです。大文字で始ま
1792-
る名前は、グローバルなユーザーコマンドや関数と被る可能性があるため、避けた方が
1793-
無難です。また、その名前を関数や変数名など、スクリプト内の他の何かに使用するこ
1794-
とはできません
1793+
語、組み込み関数名などは避けてください。名前がそれら被るからです。名前を大文字
1794+
で始めないほうがいいです。大文字で始めると、グローバルなユーザーコマンドや関数
1795+
と被る可能性があります。また、その名前を関数や変数名など、スクリプト内の他の何
1796+
かに使用することはできません
17951797

17961798
名前のドットが望ましくない場合は、関数のローカル参照を作成できます: >
17971799
var LongFunc = that.LongFuncName

en/vim9.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,10 +1033,12 @@ In Vim9 script one can use the following predefined values: >
10331033
null
10341034
null_blob
10351035
null_channel
1036+
null_class
10361037
null_dict
10371038
null_function
10381039
null_job
10391040
null_list
1041+
null_object
10401042
null_partial
10411043
null_string
10421044
`true` is the same as `v:true`, `false` the same as `v:false`, `null` the same
@@ -1555,7 +1557,7 @@ string to a number.
15551557

15561558
If a type is given where it is not expected you can get *E1272* .
15571559

1558-
If a type is incomplete you get *E1363*, e.g. when you have an object for
1560+
If a type is incomplete you get *E1363* , e.g. when you have an object for
15591561
which the class is not known (usually that is a null object).
15601562

15611563
Type inference ~
@@ -1754,7 +1756,7 @@ Exporting an item can be written as: >
17541756
export interface MyClass ...
17551757
< *E1043* *E1044*
17561758
As this suggests, only constants, variables, `:def` functions and classes can
1757-
be exported. {not implemented yet: class, interface}
1759+
be exported.
17581760

17591761
*E1042*
17601762
`:export` can only be used in Vim9 script, at the script level.
@@ -1787,7 +1789,7 @@ filename. For example: >
17871789
Then you can use "that.item", etc. You are free to choose the name "that".
17881790
Use something that will be recognized as referring to the imported script.
17891791
Avoid command names, command modifiers and builtin function names, because the
1790-
name will shadow them. Better not start the name starts with a capital
1792+
name will shadow them. It's better not to start the name with a capital
17911793
letter, since it can then also shadow global user commands and functions.
17921794
Also, you cannot use the name for something else in the script, such as a
17931795
function or variable name.
@@ -1860,9 +1862,9 @@ However, the namespace cannot be resolved on its own: >
18601862
<
18611863
This also affects the use of |<SID>| in the legacy mapping context. Since
18621864
|<SID>| is only a valid prefix for a function and NOT for a namespace, you
1863-
cannot use it
1864-
to scope a function in a script local namespace. Instead of prefixing the
1865-
function with |<SID>| you should use|<ScriptCmd>|. For example: >
1865+
cannot use it to scope a function in a script local namespace. Instead of
1866+
prefixing the function with |<SID>| you should use|<ScriptCmd>|. For example:
1867+
>
18661868
noremap ,a <ScriptCmd>:call s:that.OtherFunc()<CR>
18671869
<
18681870
*:import-cycle*

0 commit comments

Comments
 (0)