Skip to content

Commit 8fb969a

Browse files
committed
catch up doc/if_lua.jax with 7.4.1194
1 parent 9b5bce5 commit 8fb969a

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

catchup-7.4.1194.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
以上は変更点が100行未満なので、翻訳しやすいはず。
2121

22-
doc/if_lua.jax # 100行超えたけど、内容的に大したことない
2322
doc/netbeans.jax
2423
doc/spell.jax
2524
doc/tagsrch.jax
@@ -46,6 +45,7 @@
4645
doc/fold.jax
4746
doc/hangulin.jax
4847
doc/help.jax
48+
doc/if_lua.jax # 100行超えたけど、内容的に大したことない
4949
doc/if_mzsch.jax
5050
doc/if_perl.jax
5151
doc/if_pyth.jax

doc/if_lua.jax

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Vim の Lua インターフェイス *lua* *Lua*
1010
2. vim モジュール |lua-vim|
1111
3. List ユーザーデータ |lua-list|
1212
4. Dict ユーザーデータ |lua-dict|
13-
5. Funcref userdata |lua-funcref|
13+
5. Funcref ユーザーデータ |lua-funcref|
1414
6. バッファユーザーデータ |lua-buffer|
1515
7. ウィンドウユーザーデータ |lua-window|
1616
8. luaeval 関数 |lua-luaeval|
17-
9. Dynamic loading |lua-dynamic|
17+
9. 動的ローディング |lua-dynamic|
1818

1919
{Vi にはこれらのコマンドはありません}
2020

@@ -112,31 +112,31 @@ Lua からは "vim" モジュールを使って Vim を操作します。範囲
112112
バッファ操作、ウィンドウ操作、現在行の取得、Vim 式評価、Vim コマンド実行、など
113113
のルーチンが含まれています。
114114

115-
vim.list([arg]) Returns an empty list or, if "arg" is a Lua
116-
table with numeric keys 1, ..., n (a
117-
"sequence"), returns a list l such that l[i] =
118-
arg[i] for i = 1, ..., n (see |List|).
119-
Non-numeric keys are not used to initialize
120-
the list. See also |lua-eval| for conversion
121-
rules. Example: >
115+
vim.list([arg]) "arg" が 1, ..., n の数値をキーに持つ Lua のテ
116+
ーブルの時、i = 1, ..., n に対して l[i] =
117+
arg[i] となるようなリスト l を返し (|List| を参照
118+
) 、そうでなければ空のリストを返します。
119+
数値以外のキーは戻り値のリストの初期化に使われ
120+
ません。変換のルールについては |lua-eval| を参照
121+
してください。例: >
122122
:lua t = {math.pi, false, say = 'hi'}
123123
:echo luaeval('vim.list(t)')
124124
:" [3.141593, 0], 'say' is ignored
125125
<
126-
vim.dict([arg]) Returns an empty dictionary or, if "arg" is a
127-
Lua table, returns a dict d such that d[k] =
128-
arg[k] for all string keys k in "arg" (see
129-
|Dictionary|). Number keys are converted to
130-
strings. Keys that are not strings are not
131-
used to initialize the dictionary. See also
132-
|lua-eval| for conversion rules. Example: >
126+
vim.dict([arg]) "arg" が Lua のテーブルの時、"arg" のそれぞれの
127+
キー k に対して d[k] = arg[k] となるような辞書
128+
を返し (|Dictionary| を参照) 、そうでなければ空の
129+
辞書を返します。数値のキーは文字列に変換されま
130+
す。文字列以外のキーは戻り値の辞書を初期化に使
131+
使われません。変換のルールについては |lua-eval|
132+
を参照してください。例: >
133133
:lua t = {math.pi, false, say = 'hi'}
134134
:echo luaeval('vim.dict(t)')
135135
:" {'say': 'hi'}, numeric keys ignored
136136
<
137-
vim.funcref({name}) Returns a Funcref to function {name} (see
138-
|Funcref|). It is equivalent to Vim's
139-
"function". NOT IMPLEMENTED YET
137+
vim.funcref({name}) 関数 {name} への関数参照を返します (|Funcref|
138+
を参照) 。その値は Vim の "function" と等価で
139+
す。 ま だ 実 装 さ れ て い ま せ ん
140140

141141
vim.buffer([arg]) "arg" が数値ならバッファリストの "arg" 番の
142142
バッファを返す。"arg" が文字列ならフルパスか
@@ -250,19 +250,19 @@ list ユーザーデータと同様、dict ユーザーデータは vim の辞
250250
<
251251

252252
==============================================================================
253-
5. Funcref userdata *lua-funcref*
253+
5. Funcref ユーザーデータ *lua-funcref*
254254

255-
Funcref userdata represent funcref variables in Vim. Funcrefs that were
256-
defined with a "dict" attribute need to be obtained as a dictionary key
257-
in order to have "self" properly assigned to the dictionary (see examples
258-
below.) A funcref "f" has the following properties:
255+
Funcref ユーザデータは Vim における関数参照変数を表します。"dict" 属性付きで定
256+
義された関数参照 は "self" に適切に辞書が代入できるように、辞書として取得できな
257+
ければなりません (下記の例を参照してください) 。関数参照 "f" は次のプロパティを
258+
持っています:
259259

260-
Properties
260+
プロパティ
261261
----------
262-
o "#f" is the name of the function referenced by "f"
263-
o "f(...)" calls the function referenced by "f" (with arguments)
262+
o "#f" "f" が参照している関数の名前です
263+
o "f(...)" "f" が参照している関数を (引数と共に) 呼びます
264264

265-
Examples:
265+
:
266266
>
267267
:function I(x)
268268
: return a:x
@@ -378,11 +378,10 @@ Lua コードと同じです:
378378
return chunk(arg) -- return typval
379379
end
380380
<
381-
Note "_A" には "luaeval" の引数が渡されます。 Lua numbers, strings, and
382-
list, dict, and funcref userdata are converted to their Vim respective types,
383-
while Lua booleans are converted to numbers. An error is thrown if conversion
384-
of any of the remaining Lua types, including userdata other than lists, dicts,
385-
and funcrefs, is attempted.
381+
Note "_A" には "luaeval" の引数が渡されます。Lua の数値、文字列、リスト、辞書
382+
そして Funcref ユーザーデータはそれぞれの Vim の型に変換されます。ただし、Lua
383+
のブール値は数値に変換されます。リスト、辞書および関数参照以外のユーザーデータ
384+
を含む、それ以外の Lua の型を変換しようとするとエラーが返されます。
386385

387386
例: >
388387
@@ -397,22 +396,23 @@ and funcrefs, is attempted.
397396
398397
399398
==============================================================================
400-
9. Dynamic loading *lua-dynamic*
399+
9. 動的ローディング *lua-dynamic*
401400

402-
On MS-Windows and Unix the Lua library can be loaded dynamically. The
403-
|:version| output then includes |+lua/dyn|.
401+
MS-Windows Unix では Lua ライブラリを動的にロードすることができます。
402+
|+lua/dyn||:version| の出力に含まれている時に利用できます。
404403

405-
This means that Vim will search for the Lua DLL or shared library file only
406-
when needed. When you don't use the Lua interface you don't need it, thus
407-
you can use Vim without this file.
404+
これにより、Vim は必要な時だけ Lua DLL もしくは共有ライブラリを検索します。
405+
もしあなたが Lua インターフェイスを必要としておらず使わなければ Lua DLL もしく
406+
は共有ライブラリ無しで Vim を使うことができます。
408407

409-
On MS-Windows to use the Lua interface the Lua DLL must be in your search path.
410-
In a console window type "path" to see what directories are used. The version
411-
of the DLL must match the Lua version Vim was compiled with.
408+
MS-Windows で Lua インターフェイスを利用するには Lua DLL が検索パス内になければ
409+
なりません。コンソールウィンドウ内で "path" と入力し、どのディレクトリが使われ
410+
ているかを確認してください。DLL のバージョンは Vim と共にコンパイルされた Lua
411+
のバージョンと一致していなければなりません。
412412

413-
On Unix the 'luadll' option can be used to specify the Lua shared library file
414-
instead of DYNAMIC_LUA_DLL file what was specified at compile time. The
415-
version of the shared library must match the Lua version Vim was compiled with.
413+
Unix ではコンパイル時に指定された DYNAMIC_LUA_DLL ファイルの代わりに 'luadll'
414+
オプションで Lua 共有ライブラリを指定できます。共有ライブラリのバージョンは
415+
Vim と共にコンパイルされた Lua のバージョンと一致していなければなりません。
416416

417417

418418
==============================================================================

0 commit comments

Comments
 (0)