File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 1- *userfunc.txt* For Vim バージョン 9.1. Last change: 2025 Oct 12
1+ *userfunc.txt* For Vim バージョン 9.1. Last change: 2025 Oct 28
22
33
44 VIM リファレンスマニュアル by Bram Moolenaar
182182 ! が付いていると、関数が存在していなくてもエラーが発生
183183 しない。
184184 *:retu* *:return* *E133*
185- :retu[rn] [expr] 関数から戻る。" [expr]" が与えられた場合、それは評価さ
186- れ関数の結果として返される。" [expr]" が与えられない場
187- 合、 数値 0 が返される。関数が明示的な ":return" を伴わ
188- ずに終了した場合 、数値 0 が返される。
185+ :retu[rn] [expr] 関数から戻る。[expr] が与えられた場合、それは評価され
186+ 関数の結果として返される。 [expr] が与えられない場合、
187+ 数値 0 が返される。関数が明示的な ":return" を伴わずに
188+ 終了した場合 、数値 0 が返される。
189189
190190 :def 関数内で到達不可能なコードが `:return ` の後に続く
191191 場合、 *E1095* が与えられる。
@@ -422,6 +422,15 @@ Note `system()` を呼ぶ前で "Outfile" 削除がスケジュールされて
422422範囲は使えない。関数として追加の引数付きの部分適用は使えるが、辞書は使えない。
423423*E1300*
424424
425+ | :def | 関数では、ラムダ式を | :defer | とともに使用できる。例: >
426+
427+ def Fn()
428+ set lazyredraw
429+ defer () => {
430+ set lazyredraw&
431+ }()
432+ enddef
433+ <
425434==============================================================================
426435
4274364. 自動的に読み込まれる関数 ~
Original file line number Diff line number Diff line change 1- *userfunc.txt* For Vim version 9.1. Last change: 2025 Oct 12
1+ *userfunc.txt* For Vim version 9.1. Last change: 2025 Oct 28
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -189,9 +189,9 @@ See |:verbose-cmd| for more information.
189189 With the ! there is no error if the function does not
190190 exist.
191191 *:retu* *:return* *E133*
192- :retu[rn] [expr] Return from a function. When " [expr]" is given, it is
192+ :retu[rn] [expr] Return from a function. When [expr] is given, it is
193193 evaluated and returned as the result of the function.
194- If " [expr]" is not given, the number 0 is returned.
194+ If [expr] is not given, the number 0 is returned.
195195 When a function ends without an explicit ":return",
196196 the number 0 is returned.
197197
@@ -449,6 +449,15 @@ or altering execution outside of deferred functions.
449449No range is accepted. The function can be a partial with extra arguments, but
450450not with a dictionary. *E1300*
451451
452+ In a | :def | function, a lambda can be used with | :defer | . Example: >
453+
454+ def Fn()
455+ set lazyredraw
456+ defer () => {
457+ set lazyredraw&
458+ }()
459+ enddef
460+ <
452461==============================================================================
453462
4544634. Automatically loading functions ~
You can’t perform that action at this time.
0 commit comments