Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vim9.{txt,jax} #1974

Merged
merged 2 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion doc/vim9.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*vim9.txt* For Vim バージョン 9.1. Last change: 2025 Jan 21
*vim9.txt* For Vim バージョン 9.1. Last change: 2025 Mar 06

VIMリファレンスマニュアル by Bram Moolenaar

Expand Down Expand Up @@ -1923,6 +1923,11 @@ Vim9 script では、グローバルな "g:" 名前空間は従来通り使用
これにより、可能であれば Vim9 script 構文を利用したスクリプトを書くことができ
ますが、Vim9 のないバージョンでも動作するようになります。

Note Vim9 の構文は Vim 9 より前に変更されたため、現在の構文 ("import" ではなく
"import from" など) を使用するスクリプトではエラーが発生する可能性があることに
注意してください。これを防ぐには、代わりに |v:version| >= 900 をチェックする方
が安全です。

これは、2通りの方法でしか機能しません:
1. "if" 文は false と評価され、`endif` までのコマンドはスキップされ、
`vim9script` が実際に実行される最初のコマンドとなる。
Expand Down
6 changes: 5 additions & 1 deletion en/vim9.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*vim9.txt* For Vim version 9.1. Last change: 2025 Jan 21
*vim9.txt* For Vim version 9.1. Last change: 2025 Mar 06


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1921,6 +1921,10 @@ There is one way to use both legacy and Vim9 syntax in one script file: >
This allows for writing a script that takes advantage of the Vim9 script
syntax if possible, but will also work on a Vim version without it.

Note that Vim9 syntax changed before Vim 9 so that scripts using the current
syntax (such as "import from" instead of "import") might throw errors.
To prevent these, a safer check could be for |v:version| >= 900 instead.

This can only work in two ways:
1. The "if" statement evaluates to false, the commands up to `endif` are
skipped and `vim9script` is then the first command actually executed.
Expand Down