diff --git a/doc/builtin.jax b/doc/builtin.jax index 88af54164..5f9294a4e 100644 --- a/doc/builtin.jax +++ b/doc/builtin.jax @@ -1,4 +1,4 @@ -*builtin.txt* For Vim バージョン 9.1. Last change: 2024 Sep 10 +*builtin.txt* For Vim バージョン 9.1. Last change: 2024 Sep 23 VIMリファレンスマニュアル by Bram Moolenaar @@ -249,8 +249,9 @@ getcharpos({expr}) リスト カーソル、マーク、その他のカーソ getcharsearch() 辞書 最後の文字検索を取得 getcharstr([{expr}]) 文字列 ユーザーから1文字を取得する getcmdcompltype() 文字列 現在のコマンドライン補完のタイプを返す -getcmdline() 文字列 現在のコマンドラインを取得 +getcmdline() 文字列 現在のコマンドライン入力を取得 getcmdpos() 数値 コマンドラインのカーソル位置を取得 +getcmdprompt() 文字列 現在のコマンドラインプロンプトを取得 getcmdscreenpos() 数値 コマンドラインのカーソルのスクリーン位 置を返す getcmdtype() 文字列 現在のコマンドラインの種類を取得 @@ -3976,21 +3977,21 @@ getcmdcompltype() *getcmdcompltype()* コマンドラインが編集時にのみ動作するので、|c_CTRL-e| または |c_CTRL-R_=| を使用する必要がある。 返す文字列については |:command-completion| を参照のこと。 - |getcmdtype()|、|setcmdpos()|、|getcmdline()|、|setcmdline()| - も参照。 + |getcmdtype()|, |setcmdpos()|, |getcmdline()|, + |getcmdprompt()|, |setcmdline()| も参照。 補完が定義されていない場合は空文字列を返す。 戻り値の型: |String| getcmdline() *getcmdline()* - 現在のコマンドラインの内容を取得する。コマンドラインを編集して - いるときのみ動作する。つまり|c_CTRL-\_e|または|c_CTRL-R_=|を使っ - ているときのみ有効。 + 現在のコマンドライン入力の内容を取得する。コマンドラインを編集 + しているときのみ動作する。つまり |c_CTRL-\_e| または + |c_CTRL-R_=| を使っているときのみ有効。 例: > :cmap eescape(getcmdline(), ' \') -< |getcmdtype()|, |getcmdpos()|, |setcmdpos()| および - |setcmdline()| も参照。 +< |getcmdtype()|, |getcmdpos()|, |setcmdpos()|, |getcmdprompt()| + および |setcmdline()| も参照。 パスワードを入力する時や |inputsecret()| を使う時は空文字列を 返す。 @@ -4002,12 +4003,23 @@ getcmdpos() *getcmdpos()* の桁は1となる。コマンドラインを編集しているときのみ動作する。 つまり|c_CTRL-\_e|または|c_CTRL-R_=|または式マッピングを使って いるときのみ有効。そうでないときは 0 を返す。 - |getcmdtype()|, |setcmdpos()|, |getcmdline()|, |setcmdline()| - も参照。 + |getcmdtype()|, |setcmdpos()|, |getcmdline()|, + |getcmdprompt()|, |setcmdline()| も参照。 戻り値の型: |Number| +getcmdprompt() *getcmdprompt()* + |input()| や |confirm()| の関数を使用時に、現在のコマンドライ + ンプロンプトを取得する。 + コマンドラインが編集されている場合にのみ動作するため、 + |c_CTRL-\_e| または |c_CTRL-R_=| を使用する必要がある。 + |getcmdtype()|, |getcmdline()|, |getcmdpos()|, |setcmdpos()|, + および |setcmdline()| も参照。 + + 戻り値の型: |String| + + getcmdscreenpos() *getcmdscreenpos()* コマンドラインのカーソルのスクリーン位置をバイト単位で返す。最 初の桁は 1 である。 diff --git a/en/builtin.txt b/en/builtin.txt index af918d1a9..fe0b9aa33 100644 --- a/en/builtin.txt +++ b/en/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Sep 10 +*builtin.txt* For Vim version 9.1. Last change: 2024 Sep 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -232,8 +232,9 @@ getcharsearch() Dict last character search getcharstr([{expr}]) String get one character from the user getcmdcompltype() String return the type of the current command-line completion -getcmdline() String return the current command-line +getcmdline() String return the current command-line input getcmdpos() Number return cursor position in command-line +getcmdprompt() String return the current command-line prompt getcmdscreenpos() Number return cursor screen position in command-line getcmdtype() String return current command-line type @@ -3978,21 +3979,21 @@ getcmdcompltype() *getcmdcompltype()* Only works when the command line is being edited, thus requires use of |c_CTRL-\_e| or |c_CTRL-R_=|. See |:command-completion| for the return string. - Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()| and - |setcmdline()|. + Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|, + |getcmdprompt()| and |setcmdline()|. Returns an empty string when completion is not defined. Return type: |String| getcmdline() *getcmdline()* - Return the current command-line. Only works when the command - line is being edited, thus requires use of |c_CTRL-\_e| or - |c_CTRL-R_=|. + Return the current command-line input. Only works when the + command line is being edited, thus requires use of + |c_CTRL-\_e| or |c_CTRL-R_=|. Example: > :cmap eescape(getcmdline(), ' \') -< Also see |getcmdtype()|, |getcmdpos()|, |setcmdpos()| and - |setcmdline()|. +< Also see |getcmdtype()|, |getcmdpos()|, |setcmdpos()|, + |getcmdprompt()| and |setcmdline()|. Returns an empty string when entering a password or using |inputsecret()|. @@ -4005,12 +4006,23 @@ getcmdpos() *getcmdpos()* Only works when editing the command line, thus requires use of |c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping. Returns 0 otherwise. - Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()| and - |setcmdline()|. + Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|, + |getcmdprompt()| and |setcmdline()|. Return type: |Number| +getcmdprompt() *getcmdprompt()* + Return the current command-line prompt when using functions + like |input()| or |confirm()|. + Only works when the command line is being edited, thus + requires use of |c_CTRL-\_e| or |c_CTRL-R_=|. + Also see |getcmdtype()|, |getcmdline()|, |getcmdpos()|, + |setcmdpos()| and |setcmdline()|. + + Return type: |String| + + getcmdscreenpos() *getcmdscreenpos()* Return the screen position of the cursor in the command line as a byte count. The first column is 1.