|
1 |
| -*textprop.txt* For Vim version 8.2. Last change: 2021 May 26 |
| 1 | +*textprop.txt* For Vim version 8.2. Last change: 2021 Aug 16 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -108,6 +108,9 @@ prop_type_list([{props}]) get list of property types
|
108 | 108 | Manipulating text properties:
|
109 | 109 |
|
110 | 110 | prop_add({lnum}, {col}, {props}) add a text property
|
| 111 | +prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) |
| 112 | + add a text property at multiple |
| 113 | + positions. |
111 | 114 | prop_clear({lnum} [, {lnum-end} [, {bufnr}]])
|
112 | 115 | remove all text properties
|
113 | 116 | prop_find({props} [, {direction}]) search for a text property
|
@@ -157,6 +160,35 @@ prop_add({lnum}, {col}, {props})
|
157 | 160 |
|
158 | 161 | Can also be used as a |method|: >
|
159 | 162 | GetLnum()->prop_add(col, props)
|
| 163 | +< |
| 164 | + *prop_add_list()* |
| 165 | +prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...]) |
| 166 | + Similar to prop_add(), but attaches a text property at |
| 167 | + multiple positions in a buffer. |
| 168 | + |
| 169 | + {props} is a dictionary with these fields: |
| 170 | + bufnr buffer to add the property to; when omitted |
| 171 | + the current buffer is used |
| 172 | + id user defined ID for the property; must be a |
| 173 | + number; when omitted zero is used |
| 174 | + type name of the text property type |
| 175 | + All fields except "type" are optional. |
| 176 | + |
| 177 | + The second argument is a List of Lists where each list |
| 178 | + specifies the starting and ending position of the text. The |
| 179 | + first two items {lnum} and {col} specify the starting position |
| 180 | + of the text where the property will be attached and the last |
| 181 | + two items {end-lnum} and {end-col} specify the position just |
| 182 | + after the text. |
| 183 | + |
| 184 | + Example: |
| 185 | + call prop_add_list(#{type: 'MyProp', id: 2}, |
| 186 | + \ [[1, 4, 1, 7], |
| 187 | + \ [1, 15, 1, 20], |
| 188 | + \ [2, 30, 3, 30]] |
| 189 | + |
| 190 | + Can also be used as a |method|: > |
| 191 | + GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]]) |
160 | 192 |
|
161 | 193 |
|
162 | 194 | prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()*
|
@@ -211,6 +243,8 @@ prop_list({lnum} [, {props}]) *prop_list()*
|
211 | 243 | id property ID
|
212 | 244 | type name of the property type, omitted if
|
213 | 245 | the type was deleted
|
| 246 | + type_bufnr buffer number for which this type was defined; |
| 247 | + 0 if the type is global |
214 | 248 | start when TRUE property starts in this line
|
215 | 249 | end when TRUE property ends in this line
|
216 | 250 |
|
|
0 commit comments