Skip to content

Commit 1c78546

Browse files
committed
Update builtin.{txt,jax}
1 parent 566360f commit 1c78546

File tree

2 files changed

+131
-6
lines changed

2 files changed

+131
-6
lines changed

doc/builtin.jax

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim バージョン 9.1. Last change: 2024 Jan 25
1+
*builtin.txt* For Vim バージョン 9.1. Last change: 2024 Feb 01
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -160,6 +160,8 @@ delete({fname} [, {flags}]) 数値 ファイルやディレクトリ{fname}を
160160
deletebufline({buf}, {first} [, {last}])
161161
数値 バッファ {buf} から行を削除する
162162
did_filetype() 数値 FileTypeのautocommandが実行されたか?
163+
diff({fromlist}, {tolist} [, {options}])
164+
リスト 2 つの文字列のリストの差分
163165
diff_filler({lnum}) 数値 差分モードで{lnum}に挿入された行
164166
diff_hlID({lnum}, {col}) 数値 差分モードで{lnum}/{col}位置の強調
165167
digraph_get({chars}) 文字列 {chars} のダイグラフ |digraph| を取得
@@ -2071,6 +2073,64 @@ did_filetype() autocommandが実行されFileTypeイベントが一度でも起
20712073
使って 'filetype' を設定し、構文ファイルを読み込むために使え
20722074
る。
20732075

2076+
diff({fromlist}, {tolist} [, {options}]) *diff()*
2077+
{fromlist} と {tolist} の文字列の差分を含む文字列またはリスト
2078+
を返す。Vim の内部 diff ライブラリを使用して差分を計算する。
2079+
2080+
*E106*
2081+
{options} のオプションの "output" 項目は、返される diff 形式を
2082+
指定する。次の値がサポートされている:
2083+
indices 開始インデックスと終了インデックスのリストと、
2084+
各 diff hunk (差分の塊) 内の文字列数を返す。
2085+
unified unified diff 出力を文字列として返す。
2086+
これがデフォルトである。
2087+
2088+
{options} の "output" 項目が "indices" の場合、リストが返され
2089+
る。各リスト項目には、各 diff hunk (差分の塊) の以下の項目を含
2090+
む辞書が含まれている:
2091+
from_idx この diff hunk の {fromlist} 内の開始インデッ
2092+
クス。
2093+
from_count この diff hunk で追加/削除/変更された
2094+
{fromlist} 内の文字列数。
2095+
to_idx この diff hunk の {tolist} 内の開始インデック
2096+
ス。
2097+
to_count この diff hunk で追加/削除/変更された {tolist}
2098+
内の文字列数。
2099+
2100+
{options} 辞書引数は diff オプション ('diffopt' と同様) も指定
2101+
し、以下の項目をサポートする:
2102+
iblank 行がすべて空白の変更は無視する。
2103+
icase テキストの大小文字の変更を無視する。
2104+
iwhite 空白の量の変化を無視する。
2105+
iwhiteall すべての空白の変更を無視する。
2106+
iwhiteeol 行末の空白の変更を無視する。
2107+
indent-heuristic 内部 diff ライブラリのインデントヒュー
2108+
リスティックを使用する。
2109+
algorithm 使用する diff アルゴリズムを指定する辞
2110+
書。サポートされている真偽値項目は
2111+
"myers", "minimal", "patience",
2112+
"histogram"。
2113+
これらのオプションの詳細については、'diffopt' を参照。
2114+
2115+
{fromlist} と {tolist} が同一の場合、空のリストまたは文字列を
2116+
返す。
2117+
2118+
例:
2119+
:echo diff(['abc'], ['xxx'])
2120+
@@ -1 +1 @@
2121+
-abc
2122+
+xxx
2123+
2124+
:echo diff(['abc'], ['xxx'], {'output': 'indices'})
2125+
[{'from_idx': 0, 'from_count': 1, 'to_idx': 0, 'to_count': 1}]
2126+
:echo diff(readfile('oldfile'), readfile('newfile'))
2127+
:echo diff(getbufline(5, 1, '$'), getbufline(6, 1, '$'))
2128+
2129+
その他の例については、|diff-func-examples| を参照
2130+
2131+
|method| としても使用できる: >
2132+
GetFromList->diff(to_list)
2133+
<
20742134
diff_filler({lnum}) *diff_filler()*
20752135
{lnum}行目より上にある削除行の数を返す。削除行とは、差分モード
20762136
で他方のウィンドウにテキストが挿入されていることを表す行のこと
@@ -4386,13 +4446,13 @@ getwinpos([{timeout}]) *getwinpos()*
43864446
*getwinposx()*
43874447
getwinposx() 結果はGUIのVimウィンドウの左端の、デスクトップ上でのX座標値(数
43884448
値)。xtermでも機能する (100 ミリ秒のタイムアウトを使用して)。
4389-
情報が存在しない(コンソールの)場合は-1となる。
4449+
情報が存在しない (例: Wayland バックエンド) 場合は-1となる。
43904450
この値は `:winpos` でも使用される。
43914451

43924452
*getwinposy()*
43934453
getwinposy() 結果はGUIのVimウィンドウの上端の、デスクトップ上でのY座標値(数
43944454
値)。xtermでも機能する (100 ミリ秒のタイムアウトを使用して)。
4395-
情報が存在しない(コンソールの)場合は-1となる。
4455+
情報が存在しない (例: Wayland バックエンド) 場合は-1となる。
43964456
この値は `:winpos` でも使用される。
43974457

43984458
getwinvar({winnr}, {varname} [, {def}]) *getwinvar()*

en/builtin.txt

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2024 Jan 25
1+
*builtin.txt* For Vim version 9.1. Last change: 2024 Feb 01
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -147,6 +147,8 @@ delete({fname} [, {flags}]) Number delete the file or directory {fname}
147147
deletebufline({buf}, {first} [, {last}])
148148
Number delete lines from buffer {buf}
149149
did_filetype() Number |TRUE| if FileType autocmd event used
150+
diff({fromlist}, {tolist} [, {options}])
151+
List diff two Lists of strings
150152
diff_filler({lnum}) Number diff filler lines about {lnum}
151153
diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col}
152154
digraph_get({chars}) String get the |digraph| of {chars}
@@ -2046,6 +2048,67 @@ did_filetype() Returns |TRUE| when autocommands are being executed and the
20462048
editing another buffer to set 'filetype' and load a syntax
20472049
file.
20482050

2051+
diff({fromlist}, {tolist} [, {options}]) *diff()*
2052+
Returns a String or a List containing the diff between the
2053+
strings in {fromlist} and {tolist}. Uses the Vim internal
2054+
diff library to compute the diff.
2055+
2056+
*E106*
2057+
The optional "output" item in {options} specifies the returned
2058+
diff format. The following values are supported:
2059+
indices Return a List of the starting and ending
2060+
indices and a count of the strings in each
2061+
diff hunk.
2062+
unified Return the unified diff output as a String.
2063+
This is the default.
2064+
2065+
If the "output" item in {options} is "indices", then a List is
2066+
returned. Each List item contains a Dict with the following
2067+
items for each diff hunk:
2068+
from_idx start index in {fromlist} for this diff hunk.
2069+
from_count number of strings in {fromlist} that are
2070+
added/removed/modified in this diff hunk.
2071+
to_idx start index in {tolist} for this diff hunk.
2072+
to_count number of strings in {tolist} that are
2073+
added/removed/modified in this diff hunk.
2074+
2075+
The {options} Dict argument also specifies diff options
2076+
(similar to 'diffopt') and supports the following items:
2077+
iblank ignore changes where lines are all
2078+
blank.
2079+
icase ignore changes in case of text.
2080+
iwhite ignore changes in amount of white
2081+
space.
2082+
iwhiteall ignore all white space changes.
2083+
iwhiteeol ignore white space changes at end of
2084+
line.
2085+
indent-heuristic use the indent heuristic for the
2086+
internal diff library.
2087+
algorithm Dict specifying the diff algorithm to
2088+
use. Supported boolean items are
2089+
"myers", "minimal", "patience" and
2090+
"histogram".
2091+
For more information about these options, refer to 'diffopt'.
2092+
2093+
Returns an empty List or String if {fromlist} and {tolist} are
2094+
identical.
2095+
2096+
Examples:
2097+
:echo diff(['abc'], ['xxx'])
2098+
@@ -1 +1 @@
2099+
-abc
2100+
+xxx
2101+
2102+
:echo diff(['abc'], ['xxx'], {'output': 'indices'})
2103+
[{'from_idx': 0, 'from_count': 1, 'to_idx': 0, 'to_count': 1}]
2104+
:echo diff(readfile('oldfile'), readfile('newfile'))
2105+
:echo diff(getbufline(5, 1, '$'), getbufline(6, 1, '$'))
2106+
2107+
For more examples, refer to |diff-func-examples|
2108+
2109+
Can also be used as a |method|: >
2110+
GetFromList->diff(to_list)
2111+
<
20492112
diff_filler({lnum}) *diff_filler()*
20502113
Returns the number of filler lines above line {lnum}.
20512114
These are the lines that were inserted at this point in
@@ -4424,14 +4487,16 @@ getwinpos([{timeout}]) *getwinpos()*
44244487
getwinposx() The result is a Number, which is the X coordinate in pixels of
44254488
the left hand side of the GUI Vim window. Also works for an
44264489
xterm (uses a timeout of 100 msec).
4427-
The result will be -1 if the information is not available.
4490+
The result will be -1 if the information is not available
4491+
(e.g. on the Wayland backend).
44284492
The value can be used with `:winpos`.
44294493

44304494
*getwinposy()*
44314495
getwinposy() The result is a Number, which is the Y coordinate in pixels of
44324496
the top of the GUI Vim window. Also works for an xterm (uses
44334497
a timeout of 100 msec).
4434-
The result will be -1 if the information is not available.
4498+
The result will be -1 if the information is not available
4499+
(e.g. on the Wayland backend).
44354500
The value can be used with `:winpos`.
44364501

44374502
getwinvar({winnr}, {varname} [, {def}]) *getwinvar()*

0 commit comments

Comments
 (0)