Skip to content

Update if_pyth.{txt,jax} #1787

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

Merged
merged 3 commits into from
Nov 9, 2024
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
10 changes: 9 additions & 1 deletion doc/if_pyth.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim バージョン 9.1. Last change: 2024 May 16
*if_pyth.txt* For Vim バージョン 9.1. Last change: 2024 Nov 06


VIMリファレンスマニュアル by Paul Moore
Expand Down Expand Up @@ -196,6 +196,10 @@ vim.eval(str) *python-eval*
[{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~
'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] ~

NOTE: vim9script では、def 関数内のローカル変数は Python の評価では見
えません。ローカル変数を Python の評価に渡すには、|py3eval()| 等を呼び
出すときに {locals} 辞書を使用します。

vim.bindeval(str) *python-bindeval*
|python-eval| と似ていますが、特殊なオブジェクトを返します
(|python-bindeval-objects| 参照)。これを使うと Vim のリスト (|List|)
Expand Down Expand Up @@ -730,6 +734,10 @@ vim.Function オブジェクト *python-Function*
使って Python の式を評価して、その値を Vim script に渡すことができます。
|pyxeval()| も使用可能です。

オプションの {locals} 辞書を使用して、評価にローカル変数を挿入できます。これ
は、vim.eval |python-eval| が def 関数内のローカル変数を見つけられない
vim9script で特に役立ちます。

Python での "None" は v:none に変換されます。

==============================================================================
Expand Down
10 changes: 9 additions & 1 deletion en/if_pyth.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 9.1. Last change: 2024 May 16
*if_pyth.txt* For Vim version 9.1. Last change: 2024 Nov 06


VIM REFERENCE MANUAL by Paul Moore
Expand Down Expand Up @@ -201,6 +201,10 @@ vim.eval(str) *python-eval*
[{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~
'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] ~

NOTE: In vim9script, local variables in def functions are not visible
to to python evaluations. To pass local variables to python evaluations,
use the {locals} dict when calling |py3eval()| and friends.

vim.bindeval(str) *python-bindeval*
Like |python-eval|, but returns special objects described in
|python-bindeval-objects|. These python objects let you modify (|List|
Expand Down Expand Up @@ -741,6 +745,10 @@ To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
functions to evaluate Python expressions and pass their values to Vim script.
|pyxeval()| is also available.

You can inject local variables into the evaluation using the optional {locals}
dict. This can be particularly useful in vim9script where vim.eval
|python-eval| will not find locals in a def func.

The Python value "None" is converted to v:none.

==============================================================================
Expand Down