File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1- *vim9.txt* For Vim バージョン 9.1. Last change: 2025 Jan 21
1+ *vim9.txt* For Vim バージョン 9.1. Last change: 2025 Mar 05
22
33 VIMリファレンスマニュアル by Bram Moolenaar
44
@@ -1923,6 +1923,11 @@ Vim9 script では、グローバルな "g:" 名前空間は従来通り使用
19231923 これにより、可能であれば Vim9 script 構文を利用したスクリプトを書くことができ
19241924ますが、Vim9 のないバージョンでも動作するようになります。
19251925
1926+ Note Vim9 の構文は Vim 9 より前に変更されたため、現在の構文 ("import" ではなく
1927+ "import from" など) を使用するスクリプトではエラーが発生する可能性があることに
1928+ 注意してください。これを防ぐには、代わりに | v:version | >= 900 をチェックする方
1929+ が安全です。
1930+
19261931これは、2通りの方法でしか機能しません:
192719321. "if" 文は false と評価され、`endif ` までのコマンドはスキップされ、
19281933 `vim9script ` が実際に実行される最初のコマンドとなる。
@@ -2433,4 +2438,4 @@ Vim は Perl、Python、Lua、Tcl、その他いくつかへのインターフ
24332438
24342439
24352440
2436- vim:tw=78:ts=8:noet:ft=help:norl:
2441+ vim:tw=78:ts=8:noet:ft=help:norl:nofen:
Original file line number Diff line number Diff line change 1- *vim9.txt* For Vim version 9.1. Last change: 2025 Jan 21
1+ *vim9.txt* For Vim version 9.1. Last change: 2025 Mar 05
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1921,6 +1921,10 @@ There is one way to use both legacy and Vim9 syntax in one script file: >
19211921 This allows for writing a script that takes advantage of the Vim9 script
19221922syntax if possible, but will also work on a Vim version without it.
19231923
1924+ Note that Vim9 syntax changed before Vim 9 so that scripts using the current
1925+ syntax (such as "import from" instead of "import") might throw errors.
1926+ To prevent these, a safer check could be for | v:version | >= 900 instead.
1927+
19241928This can only work in two ways:
192519291. The "if" statement evaluates to false, the commands up to `endif ` are
19261930 skipped and `vim9script ` is then the first command actually executed.
@@ -2435,4 +2439,4 @@ support for classes in Vim is then a problem.
24352439
24362440
24372441
2438- vim:tw=78:ts=8:noet:ft=help:norl:
2442+ vim:tw=78:ts=8:noet:ft=help:norl:nofen:
You can’t perform that action at this time.
0 commit comments