diff --git a/doc/textprop.jax b/doc/textprop.jax index 2263bd77a..788659ff3 100644 --- a/doc/textprop.jax +++ b/doc/textprop.jax @@ -1,4 +1,4 @@ -*textprop.txt* For Vim バージョン 8.2. Last change: 2021 May 26 +*textprop.txt* For Vim バージョン 8.2. Last change: 2021 Aug 16 VIMリファレンスマニュアル by Bram Moolenaar @@ -108,6 +108,8 @@ prop_type_list([{props}]) プロパティタイプ一覧を取得 テキストプロパティの操作: prop_add({lnum}, {col}, {props}) テキストプロパティを追加 +prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) + 複数位置にテキストプロパティを追加 prop_clear({lnum} [, {lnum-end} [, {bufnr}]]) 全てのテキストプロパティを削除 prop_find({props} [, {direction}]) テキストプロパティを検索 @@ -157,6 +159,33 @@ prop_add({lnum}, {col}, {props}) |method| としても使用できる: > GetLnum()->prop_add(col, props) +< + *prop_add_list()* +prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) + prop_add() に似ているが、バッファ内の複数位置にテキストプロパ + ティが付加される。 + + {props}は次のフィールドを持つ辞書である: + bufnr プロパティを追加するバッファ。省略された場合、 + カレントバッファが使用される + id プロパティのユーザー定義ID。数字でなければなら + ない。省略時は0が使われる + type テキストプロパティ名 + "type" を除くすべてのフィールドは任意である。 + + 第2引数はリストのリストで、各リストはテキストの開始と終了の位 + 置を示す。最初の2つの項目{lnum}と{col}はプロパティを付加する開 + 始位置を、最後の2つの項目{end-lnum}と{end-col}は付加される位置 + の直後を示す。 + + 例: + call prop_add_list(#{type: 'MyProp', id: 2}, + \ [[1, 4, 1, 7], + \ [1, 15, 1, 20], + \ [2, 30, 3, 30]] + + |method| としても使用できる: > + GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]]) prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()* @@ -207,6 +236,8 @@ prop_list({lnum} [, {props}]) *prop_list()* id プロパティID type プロパティタイプ名。タイプが削除された場合は省 略される + type_bufnr プロパティタイプが定義されたバッファ番号。 + タイプがグローバルの場合は0を指定する start TRUEの時はプロパティはこの行から始まる end TRUEの時はプロパティはこの行で終わる diff --git a/en/textprop.txt b/en/textprop.txt index c1342905b..56f7619d4 100644 --- a/en/textprop.txt +++ b/en/textprop.txt @@ -1,4 +1,4 @@ -*textprop.txt* For Vim version 8.2. Last change: 2021 May 26 +*textprop.txt* For Vim version 8.2. Last change: 2021 Aug 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -108,6 +108,9 @@ prop_type_list([{props}]) get list of property types Manipulating text properties: prop_add({lnum}, {col}, {props}) add a text property +prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) + add a text property at multiple + positions. prop_clear({lnum} [, {lnum-end} [, {bufnr}]]) remove all text properties prop_find({props} [, {direction}]) search for a text property @@ -157,6 +160,35 @@ prop_add({lnum}, {col}, {props}) Can also be used as a |method|: > GetLnum()->prop_add(col, props) +< + *prop_add_list()* +prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) + Similar to prop_add(), but attaches a text property at + multiple positions in a buffer. + + {props} is a dictionary with these fields: + bufnr buffer to add the property to; when omitted + the current buffer is used + id user defined ID for the property; must be a + number; when omitted zero is used + type name of the text property type + All fields except "type" are optional. + + The second argument is a List of Lists where each list + specifies the starting and ending position of the text. The + first two items {lnum} and {col} specify the starting position + of the text where the property will be attached and the last + two items {end-lnum} and {end-col} specify the position just + after the text. + + Example: + call prop_add_list(#{type: 'MyProp', id: 2}, + \ [[1, 4, 1, 7], + \ [1, 15, 1, 20], + \ [2, 30, 3, 30]] + + Can also be used as a |method|: > + GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]]) prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()* @@ -211,6 +243,8 @@ prop_list({lnum} [, {props}]) *prop_list()* id property ID type name of the property type, omitted if the type was deleted + type_bufnr buffer number for which this type was defined; + 0 if the type is global start when TRUE property starts in this line end when TRUE property ends in this line