diff --git a/doc/repeat.jax b/doc/repeat.jax index e3046db63..56b72bab1 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: Vim9 script で、コマンドがスクリプトレベルで記述され次行へ継続するにあ +たって、旧来のバックスラッシュを使わずに行継続されるときは、最初の行のみデバッ +グ出力に表示される。 + 関数の行番号はその関数の始まりから数える。見ている行の番号を数えるのに苦労する 場合はその関数の書かれたファイルを別のVimで開き、その関数の始まりを探しだし、 "99j" を実行すること。"99" は実際の行番号に合わせて変えること。 @@ -831,6 +835,15 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 (どうすべきかがわかりにくいため)。 - 同じ名前のExコマンドを使うにはコロンを付けること: ":cont", ":next", ":finish" (省略時も) + *vim9-debug* +コンパイル済みの :def 関数をデバッグする場合、"step" はすべての命令ではなく、 +実行されるすべての行の前で停止する。これにより、ほとんどの場合は非コンパイル関 +数のように動作する。ローカル変数へのアクセスは制限されているが可能である: > + echo varname +しかし他にはあまりない。 +特定のバイトコード命令ではなく、通常のExコマンドのように実行されるコマンドを実 +行する場合、"step" はローカル変数を検査できるコンパイル済みコンテキストで1回、 +そしてコマンドを実行する直前に1回停止する。 バックトレースは、関数呼び出しの階層を表示する。例えば: >bt ~ @@ -871,8 +884,12 @@ NOTE: デバッグモードは未完成である。デバッグはVimの動作 {expression} の評価結果が異なる値となるときに常にブレークする ブレークポイントを設定する。例: > :breakadd expr g:lnum - < これはグローバル変数の lnum が変化するときに常にブレークする。 + + 評価中のエラーは抑制されるので、まだ存在しない変数の名前が使え + る。これはまた、式に間違いがあっても何も気付けないということで + もある。 + Note: |script-variable| を監視する場合、スクリプトが切り替わっ たときにブレークする。これは、定義されたスクリプト内でのみ、そ のスクリプト変数が有効だからである。そしてそのスクリプトがいく diff --git a/doc/testing.jax b/doc/testing.jax index f37dbe44d..d3b99b3b5 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| としても使用できる: > 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|: >