diff --git a/doc/builtin.jax b/doc/builtin.jax index 896021e23..3d2f559d2 100644 --- a/doc/builtin.jax +++ b/doc/builtin.jax @@ -1,4 +1,4 @@ -*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Aug 12 +*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Aug 24 VIMリファレンスマニュアル by Bram Moolenaar @@ -368,7 +368,8 @@ isinf({expr}) 数値 {expr}が無限大の値(正または負)かどうか を判定する islocked({expr}) 数値 {expr}がロックされているなら|TRUE| isnan({expr}) 数値 {expr}がNaNならば|TRUE| -items({dict}) リスト {dict}のキーと値のペアを取得 +items({expr}) リスト {expr} のキーとインデックス値のペアを + 取得 job_getchannel({job}) チャネル {job}のチャネルハンドルを取得 job_info([{job}]) 辞書 {job}についての情報を取得 job_setoptions({job}, {options}) なし {job}のオプションを設定する @@ -814,6 +815,8 @@ undofile({name}) 文字列 {name}に対するアンドゥファイルの名前 undotree([{buf}]) リスト バッファ {buf} のアンドゥファイルツリー uniq({list} [, {func} [, {dict}]]) リスト リストから隣接した重複を削除 +uri_decode({string}) 文字列 文字列を URI デコードする +uri_encode({string}) 文字列 文字列を URI エンコードする utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) 数値 {string} のバイト {idx} の UTF-16 イン デックス @@ -6240,19 +6243,31 @@ isnan({expr}) *isnan()* 戻り値の型: |Number| -items({dict}) *items()* - {dict}の全要素のキー・値のペアからなるリストを返す。戻り値の各 +items({expr}) *items()* + {expr} の全要素のキー・値のペアからなるリストを返す。戻り値の各 要素はリストであり、キーと値の2個の要素を持つ。戻り値のリスト の要素の順序は不定である。|keys()| と |values()| も参照。 + + {expr} のすべてのキー/インデックスと値のペアを含む |List| を返 + す。各 |List| の項目は 2 つの項目を持つリストである。 + - |Dict| の場合: キーと値 + - |List|、|Tuple|、|Blob| または |String| の場合: インデックス + と値 + 返される |List| は、|Dict| の場合は任意の順序で返されるが、そ + れ以外の場合はインデックスの昇順になる。 + + |keys()| および |values()| も参照。 + 例: > + let mydict = #{a: 'red', b: 'blue'} for [key, value] in items(mydict) - echo key .. ': ' .. value + echo $"{key} = {value}" endfor + echo items([1, 2, 3]) + echo items(('a', 'b', 'c')) + echo items("foobar") + echo items(0z0102) < - |List|、|Tuple| または |String| 引数もサポートされている。こ - のようなケースでは、items() はインデックスとインデックスの値 - を含むリストを返す。 - |method| としても使用できる: > mydict->items() < @@ -7508,7 +7523,7 @@ max({expr}) *max()* |method| としても使用できる: > mylist->max() < - 戻り値の型: |Number| + 戻り値の型: any。{expr} による menu_info({name} [, {mode}]) *menu_info()* @@ -7599,7 +7614,7 @@ min({expr}) *min()* |method| としても使用できる: > mylist->min() < - 戻り値の型: |Number| + 戻り値の型: any。{expr} による mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739* @@ -11925,6 +11940,58 @@ uniq({list} [, {func} [, {dict}]]) *uniq()* *E882* 戻り値の型: list<{type}> +uri_decode({string}) *uri_decode()* + パーセントエンコーディングを逆にして、{string} の URI デコード + 形式を返す ("%3D" のようなシーケンスを対応する文字に戻す)。 + + デコードは標準のパーセントデコードルールに従う: + - "%HH" は 16 進数値 HH の文字に置き換えられる。 + - デコードされたバイトが有効な UTF-8 を形成する場合、対応 + する文字に結合される。それ以外の場合、バイトはそのまま保 + 持される。 + - 無効または不完全なエンコーディング (例:"%GZ"、"%3"、末 + 尾の "%") は変更されない。 + + {string} が空の場合、空の文字列を返す。 + + 例: > + :echo uri_decode('c%3A%5Cmy%5Cdir%5Cfoo%20bar') + c:\my\dir\foo bar + :echo uri_decode('%CE%B1%CE%B2%CE%B3') + αβγ +< + |method| としても使用できる: > + mystr->uri_decode() +< + 戻り値の型: |String| + +uri_encode({string}) *uri_encode()* + {string} の URI エンコード形式を返す。URI エンコードでは、安全 + でない文字や予約文字がパーセントエンコードされたシーケンスに置 + き換えられる。 + + エンコーディングは標準のパーセントエンコーディングルールに従 + う。 + - 英数字 [0-9A-Za-z] は変更されない。 + - 文字 "-"、"_"、"." および "~" も変更されない。 + - その他の文字はすべて "%HH" に置き換えられる。HH は 2 桁 + の大文字の 16 進数値である。 + - 既存のパーセントエンコードされたシーケンスは変更されな + い。 + + {string} が空の場合、空の文字列を返す。 + + 例: > + :echo uri_encode('c:\my\dir\foo bar') + c%3A%5Cmy%5Cdir%5Cfoo%20bar + :echo uri_encode('key=value&name=αβγ') + key%3Dvalue%26name%3D%CE%B1%CE%B2%CE%B3 +< + |method| としても使用できる: > + mystr->uri_encode() +< + 戻り値の型: |String| + *utf16idx()* utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) |charidx()| と同じだが、{string} の {idx} にあるバイトの @@ -12769,6 +12836,8 @@ scrollbind 'scrollbind' をサポート (常に true) showcmd 'showcmd' をサポート signs |:sign|をサポート smartindent 'smartindent' をサポート。(常に true) +socketserver ソケットサーバー機能付きでコンパイルされている。(Unix + のみ) sodium libsodium ライブラリによるより良い暗号のサポート sound サウンド再生をサポート。例えば、`sound_playevent()` spell スペルチェックをサポート |spell| diff --git a/en/builtin.txt b/en/builtin.txt index 752d0515d..418bc47e5 100644 --- a/en/builtin.txt +++ b/en/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 12 +*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 24 VIM REFERENCE MANUAL by Bram Moolenaar @@ -344,7 +344,7 @@ isinf({expr}) Number determine if {expr} is infinity value (positive or negative) islocked({expr}) Number |TRUE| if {expr} is locked isnan({expr}) Number |TRUE| if {expr} is NaN -items({dict}) List key-value pairs in {dict} +items({expr}) List key/index-value pairs in {expr} job_getchannel({job}) Channel get the channel handle for {job} job_info([{job}]) Dict get information about {job} job_setoptions({job}, {options}) none set options for {job} @@ -747,6 +747,8 @@ undofile({name}) String undo file name for {name} undotree([{buf}]) List undo file tree for buffer {buf} uniq({list} [, {func} [, {dict}]]) List remove adjacent duplicates from a list +uri_decode({string}) String URI-decode a string +uri_encode({string}) String URI-encode a string utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) Number UTF-16 index of byte {idx} in {string} values({dict}) List values in {dict} @@ -6310,20 +6312,27 @@ isnan({expr}) *isnan()* Return type: |Number| -items({dict}) *items()* - Return a |List| with all the key-value pairs of {dict}. Each - |List| item is a list with two items: the key of a {dict} - entry and the value of this entry. The |List| is in arbitrary - order. Also see |keys()| and |values()|. - Example: > +items({expr}) *items()* + Return a |List| with all key/index and value pairs of {expr}. + Each |List| item is a list with two items: + - for a |Dict|: the key and the value + - for a |List|, |Tuple|, |Blob| or |String|: the index and the + value + The returned |List| is in arbitrary order for a |Dict|, + otherwise it's in ascending order of the index. + + Also see |keys()| and |values()|. + + Examples: > + let mydict = #{a: 'red', b: 'blue'} for [key, value] in items(mydict) - echo key .. ': ' .. value + echo $"{key} = {value}" endfor + echo items([1, 2, 3]) + echo items(('a', 'b', 'c')) + echo items("foobar") + echo items(0z0102) < - A |List|, a |Tuple| or a |String| argument is also supported. - In these cases, items() returns a List with the index and the - value at the index. - Can also be used as a |method|: > mydict->items() < @@ -7617,7 +7626,7 @@ max({expr}) *max()* Can also be used as a |method|: > mylist->max() < - Return type: |Number| + Return type: any, depending on {expr} menu_info({name} [, {mode}]) *menu_info()* @@ -7709,7 +7718,7 @@ min({expr}) *min()* Can also be used as a |method|: > mylist->min() < - Return type: |Number| + Return type: any, depending on {expr} mkdir({name} [, {flags} [, {prot}]]) *mkdir()* *E739* @@ -12180,6 +12189,59 @@ uniq({list} [, {func} [, {dict}]]) *uniq()* *E882* Return type: list<{type}> +uri_decode({string}) *uri_decode()* + Returns the URI-decoded form of {string}, reversing + percent-encoding (converting sequences like "%3D" back to + the corresponding character). + + The decoding follows standard percent-decoding rules: + - "%HH" is replaced with the character for the hex value + HH. + - If the decoded bytes form valid UTF-8, they are combined + into the corresponding character(s). Otherwise, the + bytes are kept as-is. + - Invalid or incomplete encodings (e.g. "%GZ", "%3", or a + trailing "%") are left unchanged. + + Returns an empty String if {string} is empty. + + Example: > + :echo uri_decode('c%3A%5Cmy%5Cdir%5Cfoo%20bar') + c:\my\dir\foo bar + :echo uri_decode('%CE%B1%CE%B2%CE%B3') + αβγ +< + Can also be used as a |method|: > + mystr->uri_decode() +< + Return type: |String| + +uri_encode({string}) *uri_encode()* + Returns the URI-encoded form of {string}. URI encoding + replaces unsafe or reserved characters with percent-encoded + sequences. + + The encoding follows standard percent-encoding rules: + - Alphanumeric characters [0-9A-Za-z] remain unchanged. + - The characters "-", "_", ".", and "~" also remain + unchanged. + - All other characters are replaced with "%HH", where HH + is the two-digit uppercase hexadecimal value. + - Existing percent-encoded sequences are not modified. + + Returns an empty String if {string} is empty. + + Example: > + :echo uri_encode('c:\my\dir\foo bar') + c%3A%5Cmy%5Cdir%5Cfoo%20bar + :echo uri_encode('key=value&name=αβγ') + key%3Dvalue%26name%3D%CE%B1%CE%B2%CE%B3 +< + Can also be used as a |method|: > + mystr->uri_encode() +< + Return type: |String| + *utf16idx()* utf16idx({string}, {idx} [, {countcc} [, {charidx}]]) Same as |charidx()| but returns the UTF-16 code unit index of @@ -13042,6 +13104,7 @@ scrollbind Compiled with 'scrollbind' support. (always true) showcmd Compiled with 'showcmd' support. signs Compiled with |:sign| support. smartindent Compiled with 'smartindent' support. (always true) +socketserver Compiled with socket server functionality. (Unix only) sodium Compiled with libsodium for better crypt support sound Compiled with sound support, e.g. `sound_playevent()` spell Compiled with spell checking support |spell|.