From 620da206093971d98873c416bc0e786da8177b9e Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Wed, 1 Dec 2021 22:00:50 +0900 Subject: [PATCH 1/8] {repeat,testing}.txt: Update Vim 8.2.3715 --- en/repeat.txt | 22 ++++++++++++++++++++-- en/testing.txt | 34 +++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/en/repeat.txt b/en/repeat.txt index c6b4b9e9f..049fabb30 100644 --- a/en/repeat.txt +++ b/en/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 8.2. Last change: 2021 Jun 11 +*repeat.txt* For Vim version 8.2. Last change: 2021 Nov 24 VIM REFERENCE MANUAL by Bram Moolenaar @@ -792,6 +792,10 @@ won't be very helpful. There is a separate command-line history for debug mode. +NOTE: In Vim9 script, if a command is written at the script level and +continues on the next line, not using the old way with a backslash for line +continuation, only the first line is printed before the debugging prompt. + The line number for a function line is relative to the start of the function. If you have trouble figuring out where you are, edit the file that defines the function in another Vim, search for the start of the function and do @@ -844,6 +848,16 @@ About the additional commands in debug mode: is reset (because it's not clear what you want to repeat). - When you want to use the Ex command with the same name, prepend a colon: ":cont", ":next", ":finish" (or shorter). + *vim9-debug* +When debugging a compiled :def function, "step" will stop before every +executed line, not every single instruction. Thus it works mostly like a not +compiled function. Access to local variables is limited you can use: > + echo varname +But not much else. +When executing a command that is not a specific bytecode instruction but +executed like a normal Ex command, "step" will stop once in the compiled +context, where local variables can be inspected, and once just before +executing the command. The backtrace shows the hierarchy of function calls, e.g.: >bt ~ @@ -883,8 +897,12 @@ DEFINING BREAKPOINTS Sets a breakpoint, that will break whenever the {expression} evaluates to a different value. Example: > :breakadd expr g:lnum - < Will break, whenever the global variable lnum changes. + + Errors in evaluation are suppressed, you can use the name of a + variable that does not exist yet. This also means you will + not notice anything if the expression has a mistake. + Note if you watch a |script-variable| this will break when switching scripts, since the script variable is only valid in the script where it has been defined and if that diff --git a/en/testing.txt b/en/testing.txt index be2896e23..d064dc1bf 100644 --- a/en/testing.txt +++ b/en/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 8.2. Last change: 2021 Jul 07 +*testing.txt* For Vim version 8.2. Last change: 2021 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -46,6 +46,7 @@ test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* Can also be used as a |method|: > GetAllocId()->test_alloc_fail() + test_autochdir() *test_autochdir()* Set a flag to enable the effect of 'autochdir' before Vim startup has finished. @@ -59,6 +60,7 @@ test_feedinput({string}) *test_feedinput()* Can also be used as a |method|: > GetText()->test_feedinput() + test_garbagecollect_now() *test_garbagecollect_now()* Like garbagecollect(), but executed right away. This must only be called directly to avoid any structure to exist @@ -83,14 +85,14 @@ test_getvalue({name}) *test_getvalue()* test_gui_drop_files({list}, {row}, {col}, {mods}) Drop one or more files in {list} in the window at {row}, {col}. This function only works when the GUI is running and the - |drag-n-drop| feature is present. - + |drop_file| feature is present. + The supported values for {mods} are: 0x4 Shift 0x8 Alt 0x10 Ctrl - The files are added to the argument list and the first file in - {list} is edited in the window. See |drag-n-drop| for more + The files are added to the |argument-list| and the first file + in {list} is edited in the window. See |drag-n-drop| for more information. *test_gui_mouse_event()* @@ -132,6 +134,7 @@ test_ignore_error({expr}) *test_ignore_error()* Can also be used as a |method|: > GetErrorText()->test_ignore_error() + test_null_blob() *test_null_blob()* Return a |Blob| that is null. Only useful for testing. @@ -166,13 +169,6 @@ test_null_string() *test_null_string()* Return a |String| that is null. Only useful for testing. -test_unknown() *test_unknown()* - Return a value with unknown type. Only useful for testing. - -test_void() *test_void()* - Return a value with void type. Only useful for testing. - - test_option_not_set({name}) *test_option_not_set()* Reset the flag that indicates option {name} was set. Thus it looks like it still has the default value. Use like this: > @@ -224,6 +220,7 @@ test_override({name}, {val}) *test_override()* < Can also be used as a |method|: > GetOverrideVal()-> test_override('starting') + test_refcount({expr}) *test_refcount()* Return the reference count of {expr}. When {expr} is of a type that does not have a reference count, returns -1. Only @@ -253,6 +250,7 @@ test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()* Can also be used as a |method|: > GetValue()->test_scrollbar('right', 0) + test_setmouse({row}, {col}) *test_setmouse()* Set the mouse position to be used for the next mouse action. {row} and {col} are one based. @@ -260,6 +258,7 @@ test_setmouse({row}, {col}) *test_setmouse()* call test_setmouse(4, 20) call feedkeys("\", "xt") + test_settime({expr}) *test_settime()* Set the time Vim uses internally. Currently only used for timestamps in the history, as they are used in viminfo, and @@ -272,10 +271,19 @@ test_settime({expr}) *test_settime()* Can also be used as a |method|: > GetTime()->test_settime() + test_srand_seed([seed]) *test_srand_seed()* When [seed] is given this sets the seed value used by `srand()`. When omitted the test seed is removed. + +test_unknown() *test_unknown()* + Return a value with unknown type. Only useful for testing. + + +test_void() *test_void()* + Return a value with void type. Only useful for testing. + ============================================================================== 3. Assert functions *assert-functions-details* @@ -446,7 +454,7 @@ assert_notmatch({pattern}, {actual} [, {msg}]) assert_report({msg}) *assert_report()* - Report a test failure directly, using {msg}. + Report a test failure directly, using String {msg}. Always returns one. Can also be used as a |method|: > From bb144d23bc84aec93e92916c663e315f955c79cb Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Wed, 1 Dec 2021 22:11:16 +0900 Subject: [PATCH 2/8] {repeat,testing}.jax: Update Vim 8.2.3715 translate a part --- doc/repeat.jax | 22 ++++++++++++++++++++-- doc/testing.jax | 36 ++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/doc/repeat.jax b/doc/repeat.jax index e3046db63..1300eaa96 100644 --- a/doc/repeat.jax +++ b/doc/repeat.jax @@ -1,4 +1,4 @@ -*repeat.txt* For Vim バージョン 8.2. Last change: 2021 Jun 11 +*repeat.txt* For Vim バージョン 8.2. Last change: 2021 Nov 24 VIMリファレンスマニュアル by Bram Moolenaar @@ -781,6 +781,10 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 デバッグモードのためのコマンドラインヒストリが別に用意されている。 +NOTE: In Vim9 script, if a command is written at the script level and +continues on the next line, not using the old way with a backslash for line +continuation, only the first line is printed before the debugging prompt. + 関数の行番号はその関数の始まりから数える。見ている行の番号を数えるのに苦労する 場合はその関数の書かれたファイルを別のVimで開き、その関数の始まりを探しだし、 "99j" を実行すること。"99" は実際の行番号に合わせて変えること。 @@ -831,6 +835,16 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 (どうすべきかがわかりにくいため)。 - 同じ名前のExコマンドを使うにはコロンを付けること: ":cont", ":next", ":finish" (省略時も) + *vim9-debug* +When debugging a compiled :def function, "step" will stop before every +executed line, not every single instruction. Thus it works mostly like a not +compiled function. Access to local variables is limited you can use: > + echo varname +But not much else. +When executing a command that is not a specific bytecode instruction but +executed like a normal Ex command, "step" will stop once in the compiled +context, where local variables can be inspected, and once just before +executing the command. バックトレースは、関数呼び出しの階層を表示する。例えば: >bt ~ @@ -871,8 +885,12 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 {expression} の評価結果が異なる値となるときに常にブレークする ブレークポイントを設定する。例: > :breakadd expr g:lnum - < これはグローバル変数の lnum が変化するときに常にブレークする。 + + Errors in evaluation are suppressed, you can use the name of a + variable that does not exist yet. This also means you will + not notice anything if the expression has a mistake. + Note: |script-variable| を監視する場合、スクリプトが切り替わっ たときにブレークする。これは、定義されたスクリプト内でのみ、そ のスクリプト変数が有効だからである。そしてそのスクリプトがいく diff --git a/doc/testing.jax b/doc/testing.jax index f37dbe44d..647f6e17f 100644 --- a/doc/testing.jax +++ b/doc/testing.jax @@ -1,4 +1,4 @@ -*testing.txt* For Vim バージョン 8.2. Last change: 2021 Jul 07 +*testing.txt* For Vim バージョン 8.2. Last change: 2021 Aug 15 VIMリファレンスマニュアル by Bram Moolenaar @@ -46,6 +46,7 @@ test_alloc_fail({id}, {countdown}, {repeat}) *test_alloc_fail()* |method| としても使用できる: > GetAllocId()->test_alloc_fail() + test_autochdir() *test_autochdir()* Vimの起動が完了する前に 'autochdir' の効果を有効にするためのフ ラグをセットする。 @@ -59,6 +60,7 @@ test_feedinput({string}) *test_feedinput()* |method| としても使用できる: > GetText()->test_feedinput() + test_garbagecollect_now() *test_garbagecollect_now()* garbagecollect() とほぼ同じであるが、この関数はガーベッジコレ クトを直ちに実行する。この関数を実行する場合は、構造体が内部に @@ -82,15 +84,16 @@ test_getvalue({name}) *test_getvalue()* *test_gui_drop_files()* test_gui_drop_files({list}, {row}, {col}, {mods}) {list} の1つ以上のファイルをウィンドウの {row} 行 {col} 列にド - ロップする。この関数は |drag-n-drop| 機能が存在するGUI版のVim - でのみ動作する。 + ロップする。この関数は |drop_file| 機能が存在するGUI版のVim で + のみ動作する。 {mods} としてサポートされる値: 0x4 Shift 0x8 Alt 0x10 Ctrl - ファイルは引数リストに追加され、{list} の最初のファイルの編集 - がウィンドウで開始される。詳細は |drag-n-drop| を参照。 + ファイルは引数リスト |argument-list| に追加され、{list} の最初 + のファイルの編集がウィンドウで開始される。詳細は |drag-n-drop| + を参照。 *test_gui_mouse_event()* test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers}) @@ -131,6 +134,7 @@ test_ignore_error({expr}) *test_ignore_error()* |method| としても使用できる: > GetErrorText()->test_ignore_error() + test_null_blob() *test_null_blob()* null の |Blob| を返す。これはテストのみに使われる。 @@ -165,14 +169,6 @@ test_null_string() *test_null_string()* null の |String| を返す。これはテストのみに使われる。 -test_unknown() *test_unknown()* - unknown型の値を返す。これはテストのみに使われる。 - - -test_void() *test_void()* - void型の値を返す。これはテストのみに使われる。 - - test_option_not_set({name}) *test_option_not_set()* オプション {name} が設定されたことを示すフラグをリセットする。 したがって、それはまだデフォルト値を持っているように見える。次 @@ -224,6 +220,7 @@ test_override({name}, {val}) *test_override()* < |method| としても使用できる: > GetOverrideVal()-> test_override('starting') + test_refcount({expr}) *test_refcount()* {expr} の参照カウントを返す。{expr} が参照カウントを持たない型 の場合は、-1 を返す。この関数はテスト用。 @@ -253,6 +250,7 @@ test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()* |method| としても使用できる: > GetValue()->test_scrollbar('right', 0) + test_setmouse({row}, {col}) *test_setmouse()* 次のマウス操作に使用するマウス位置を設定する。 {row} と {col} は 1ベースである。 @@ -260,6 +258,7 @@ test_setmouse({row}, {col}) *test_setmouse()* call test_setmouse(4, 20) call feedkeys("\", "xt") + test_settime({expr}) *test_settime()* Vim が内部的に用いる時間を設定する。現在は history のタイムス タンプ、viminfo のタイムスタンプ、undo に使用されている。 @@ -271,10 +270,19 @@ test_settime({expr}) *test_settime()* |method| としても使用できる: > GetTime()->test_settime() + test_srand_seed([seed]) *test_srand_seed()* [seed] が渡されたときは `srand()` で使われる種の値を設定する。 省略されたときはテスト用の種を削除する。 + +test_unknown() *test_unknown()* + unknown型の値を返す。これはテストのみに使われる。 + + +test_void() *test_void()* + void型の値を返す。これはテストのみに使われる。 + ============================================================================== 3. Assert関数 *assert-functions-details* @@ -440,7 +448,7 @@ assert_notmatch({pattern}, {actual} [, {msg}]) assert_report({msg}) *assert_report()* - テストの失敗を {msg} を使って直接報告する。 + テストの失敗を文字列 {msg} を使って直接報告する。 常に 1 を返す。 |method| としても使用できる: > From 96c59a34f6821295d563bb670e9704e0d2bf52ac Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Wed, 1 Dec 2021 23:13:23 +0900 Subject: [PATCH 3/8] {repeat,testing}.jax: Update Vim 8.2.3715 translate a part --- doc/repeat.jax | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/doc/repeat.jax b/doc/repeat.jax index 1300eaa96..6714ca718 100644 --- a/doc/repeat.jax +++ b/doc/repeat.jax @@ -781,9 +781,9 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 デバッグモードのためのコマンドラインヒストリが別に用意されている。 -NOTE: In Vim9 script, if a command is written at the script level and -continues on the next line, not using the old way with a backslash for line -continuation, only the first line is printed before the debugging prompt. +NOTE: Vim9 scriptで、コマンドがスクリプトレベルで記述されて次行へ続くとき、旧 +来のバックスラッシュを使わずに行継続するため、最初の行のみデバッグ出力に印刷さ +れる。 関数の行番号はその関数の始まりから数える。見ている行の番号を数えるのに苦労する 場合はその関数の書かれたファイルを別のVimで開き、その関数の始まりを探しだし、 @@ -836,15 +836,14 @@ continuation, only the first line is printed before the debugging prompt. - 同じ名前のExコマンドを使うにはコロンを付けること: ":cont", ":next", ":finish" (省略時も) *vim9-debug* -When debugging a compiled :def function, "step" will stop before every -executed line, not every single instruction. Thus it works mostly like a not -compiled function. Access to local variables is limited you can use: > +コンパイルされている :def 関数をデバッグする時、"step" は各実行行で、単一の命 +令毎ではない。これにより多くの場合は非コンパイル関数と同様に動く。ローカル変数 +へのアクセスは制限されるが使える: > echo varname -But not much else. -When executing a command that is not a specific bytecode instruction but -executed like a normal Ex command, "step" will stop once in the compiled -context, where local variables can be inspected, and once just before -executing the command. +しかし他にあまりない。 +特定のバイトコード命令ではないが通常のExコマンドのように実行するコマンドを実行 +する時、"step" はコンパイルされているコンテキストで1度止まり、ローカル変数を検 +査でき、その直前は一度に実行したコマンドになる。 バックトレースは、関数呼び出しの階層を表示する。例えば: >bt ~ @@ -887,9 +886,8 @@ executing the command. :breakadd expr g:lnum < これはグローバル変数の lnum が変化するときに常にブレークする。 - Errors in evaluation are suppressed, you can use the name of a - variable that does not exist yet. This also means you will - not notice anything if the expression has a mistake. + 実行時のエラーは抑制され、まだ存在しない変数の名前が使える。こ + れはまた式に問題があっても気付けないということでもある。 Note: |script-variable| を監視する場合、スクリプトが切り替わっ たときにブレークする。これは、定義されたスクリプト内でのみ、そ From 171ea02697adeae3b0ffa0e53ed9ecdff6de4525 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 13 Dec 2021 19:41:12 +0900 Subject: [PATCH 4/8] repeat.jax: fix review suggestion Co-authored-by: h_east --- doc/repeat.jax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/repeat.jax b/doc/repeat.jax index 6714ca718..ba816ff6c 100644 --- a/doc/repeat.jax +++ b/doc/repeat.jax @@ -782,7 +782,7 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 デバッグモードのためのコマンドラインヒストリが別に用意されている。 NOTE: Vim9 scriptで、コマンドがスクリプトレベルで記述されて次行へ続くとき、旧 -来のバックスラッシュを使わずに行継続するため、最初の行のみデバッグ出力に印刷さ +来のバックスラッシュを使わずに行継続するため、最初の行のみデバッグ出力に表示さ れる。 関数の行番号はその関数の始まりから数える。見ている行の番号を数えるのに苦労する From de1ea9358699038c6825f09a33365fdba2b08b65 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 13 Dec 2021 19:43:34 +0900 Subject: [PATCH 5/8] repeat.jax: fix translate Co-authored-by: h_east --- doc/repeat.jax | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/repeat.jax b/doc/repeat.jax index ba816ff6c..478baf471 100644 --- a/doc/repeat.jax +++ b/doc/repeat.jax @@ -886,8 +886,9 @@ NOTE: Vim9 scriptで、コマンドがスクリプトレベルで記述されて :breakadd expr g:lnum < これはグローバル変数の lnum が変化するときに常にブレークする。 - 実行時のエラーは抑制され、まだ存在しない変数の名前が使える。こ - れはまた式に問題があっても気付けないということでもある。 + 評価中のエラーは抑制されるので、まだ存在しない変数の名前が使え + る。これはまた、式に間違いがあっても何も気付けないということで + もある。 Note: |script-variable| を監視する場合、スクリプトが切り替わっ たときにブレークする。これは、定義されたスクリプト内でのみ、そ From 79f19d056354b9e5019bd30b9cd7b0a1790c8a6c Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 13 Dec 2021 19:45:28 +0900 Subject: [PATCH 6/8] repeat.jax: re-translate a part Co-authored-by: h_east --- doc/repeat.jax | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/repeat.jax b/doc/repeat.jax index 478baf471..f6d3cadd3 100644 --- a/doc/repeat.jax +++ b/doc/repeat.jax @@ -836,14 +836,14 @@ NOTE: Vim9 scriptで、コマンドがスクリプトレベルで記述されて - 同じ名前のExコマンドを使うにはコロンを付けること: ":cont", ":next", ":finish" (省略時も) *vim9-debug* -コンパイルされている :def 関数をデバッグする時、"step" は各実行行で、単一の命 -令毎ではない。これにより多くの場合は非コンパイル関数と同様に動く。ローカル変数 -へのアクセスは制限されるが使える: > +コンパイル済みの :def 関数をデバッグする場合、"step" はすべての命令ではなく、 +実行されるすべての行の前で停止する。これにより、ほとんどの場合は非コンパイル関 +数のように動作する。ローカル変数へのアクセスは制限されているが可能である: > echo varname -しかし他にあまりない。 -特定のバイトコード命令ではないが通常のExコマンドのように実行するコマンドを実行 -する時、"step" はコンパイルされているコンテキストで1度止まり、ローカル変数を検 -査でき、その直前は一度に実行したコマンドになる。 +しかし他にはあまりない。 +特定のバイトコード命令ではなく、通常のExコマンドのように実行されるコマンドを実 +行する場合、"step" はローカル変数を検査できるコンパイル済みコンテキストで1回、 +そしてコマンドを実行する直前に1回停止する。 バックトレースは、関数呼び出しの階層を表示する。例えば: >bt ~ From c50b23320dd7c48b6b4dfa0ff4b95aff0c67b39c Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 13 Dec 2021 22:54:57 +0900 Subject: [PATCH 7/8] {repeat,testing}.jax: fix spacing and translate Co-authored-by: K.Takata --- doc/repeat.jax | 6 +++--- doc/testing.jax | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/repeat.jax b/doc/repeat.jax index f6d3cadd3..bdc6a6e88 100644 --- a/doc/repeat.jax +++ b/doc/repeat.jax @@ -781,9 +781,9 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 デバッグモードのためのコマンドラインヒストリが別に用意されている。 -NOTE: Vim9 scriptで、コマンドがスクリプトレベルで記述されて次行へ続くとき、旧 -来のバックスラッシュを使わずに行継続するため、最初の行のみデバッグ出力に表示さ -れる。 +NOTE: Vim9 script で、コマンドがスクリプトレベルで記述されて次行へ続いて、旧来 +のバックスラッシュを使わずに行継続するとき、最初の行のみデバッグ出力に表示され +る。 関数の行番号はその関数の始まりから数える。見ている行の番号を数えるのに苦労する 場合はその関数の書かれたファイルを別のVimで開き、その関数の始まりを探しだし、 diff --git a/doc/testing.jax b/doc/testing.jax index 647f6e17f..d3b99b3b5 100644 --- a/doc/testing.jax +++ b/doc/testing.jax @@ -84,8 +84,8 @@ test_getvalue({name}) *test_getvalue()* *test_gui_drop_files()* test_gui_drop_files({list}, {row}, {col}, {mods}) {list} の1つ以上のファイルをウィンドウの {row} 行 {col} 列にド - ロップする。この関数は |drop_file| 機能が存在するGUI版のVim で - のみ動作する。 + ロップする。この関数は |drop_file| 機能が存在するGUI版の Vim + でのみ動作する。 {mods} としてサポートされる値: 0x4 Shift From c45503cbed69569f0c2de72819602c90531322d0 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 13 Dec 2021 23:19:19 +0900 Subject: [PATCH 8/8] repeat.jax: fix for more adjust --- doc/repeat.jax | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/repeat.jax b/doc/repeat.jax index bdc6a6e88..56b72bab1 100644 --- a/doc/repeat.jax +++ b/doc/repeat.jax @@ -781,9 +781,9 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 デバッグモードのためのコマンドラインヒストリが別に用意されている。 -NOTE: Vim9 script で、コマンドがスクリプトレベルで記述されて次行へ続いて、旧来 -のバックスラッシュを使わずに行継続するとき、最初の行のみデバッグ出力に表示され -る。 +NOTE: Vim9 script で、コマンドがスクリプトレベルで記述され次行へ継続するにあ +たって、旧来のバックスラッシュを使わずに行継続されるときは、最初の行のみデバッ +グ出力に表示される。 関数の行番号はその関数の始まりから数える。見ている行の番号を数えるのに苦労する 場合はその関数の書かれたファイルを別のVimで開き、その関数の始まりを探しだし、