comparison runtime/doc/textprop.txt @ 17980:52f23198af7f v8.1.1986

patch 8.1.1986: more functions can be used as methods Commit: https://github.com/vim/vim/commit/a5a7882ea4a21944924b778208e1d54734891033 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 4 21:57:18 2019 +0200 patch 8.1.1986: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make textprop functions usable as a method.
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Sep 2019 22:00:03 +0200
parents cc953757ed2a
children 834b7854aa3c
comparison
equal deleted inserted replaced
17979:cc69bca7313b 17980:52f23198af7f
1 *textprop.txt* For Vim version 8.1. Last change: 2019 Aug 25 1 *textprop.txt* For Vim version 8.1. Last change: 2019 Sep 04
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
155 added to. When not found, the global property types are used. 155 added to. When not found, the global property types are used.
156 If not found an error is given. 156 If not found an error is given.
157 157
158 See |text-properties| for information about text properties. 158 See |text-properties| for information about text properties.
159 159
160 Can also be used as a |method|: >
161 GetLnum()->prop_add(col, props)
162
160 163
161 prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()* 164 prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()*
162 Remove all text properties from line {lnum}. 165 Remove all text properties from line {lnum}.
163 When {lnum-end} is given, remove all text properties from line 166 When {lnum-end} is given, remove all text properties from line
164 {lnum} to {lnum-end} (inclusive). 167 {lnum} to {lnum-end} (inclusive).
166 When {props} contains a "bufnr" item use this buffer, 169 When {props} contains a "bufnr" item use this buffer,
167 otherwise use the current buffer. 170 otherwise use the current buffer.
168 171
169 See |text-properties| for information about text properties. 172 See |text-properties| for information about text properties.
170 173
174 Can also be used as a |method|: >
175 GetLnum()->prop_clear()
176 <
171 *prop_find()* 177 *prop_find()*
172 prop_find({props} [, {direction}]) 178 prop_find({props} [, {direction}])
173 {not implemented yet} 179 {not implemented yet}
174 Search for a text property as specified with {props}: 180 Search for a text property as specified with {props}:
175 id property with this ID 181 id property with this ID
218 When "end" is zero the property continues in the next line. 224 When "end" is zero the property continues in the next line.
219 The line break after this line is included. 225 The line break after this line is included.
220 226
221 See |text-properties| for information about text properties. 227 See |text-properties| for information about text properties.
222 228
223 229 Can also be used as a |method|: >
230 GetLnum()->prop_list()
231 <
224 *prop_remove()* *E968* 232 *prop_remove()* *E968*
225 prop_remove({props} [, {lnum} [, {lnum-end}]]) 233 prop_remove({props} [, {lnum} [, {lnum-end}]])
226 Remove a matching text property from line {lnum}. When 234 Remove a matching text property from line {lnum}. When
227 {lnum-end} is given, remove matching text properties from line 235 {lnum-end} is given, remove matching text properties from line
228 {lnum} to {lnum-end} (inclusive). 236 {lnum} to {lnum-end} (inclusive).
240 If buffer "bufnr" is not loaded then nothing happens. 248 If buffer "bufnr" is not loaded then nothing happens.
241 249
242 Returns the number of properties that were removed. 250 Returns the number of properties that were removed.
243 251
244 See |text-properties| for information about text properties. 252 See |text-properties| for information about text properties.
253
254 Can also be used as a |method|: >
255 GetProps()->prop_remove()
245 256
246 257
247 prop_type_add({name}, {props}) *prop_type_add()* *E969* *E970* 258 prop_type_add({name}, {props}) *prop_type_add()* *E969* *E970*
248 Add a text property type {name}. If a property type with this 259 Add a text property type {name}. If a property type with this
249 name already exists an error is given. Nothing is returned. 260 name already exists an error is given. Nothing is returned.
265 end_incl when TRUE inserts at the end position will be 276 end_incl when TRUE inserts at the end position will be
266 included in the text property 277 included in the text property
267 278
268 See |text-properties| for information about text properties. 279 See |text-properties| for information about text properties.
269 280
281 Can also be used as a |method|: >
282 GetPropName()->prop_type_add(props)
270 283
271 prop_type_change({name}, {props}) *prop_type_change()* 284 prop_type_change({name}, {props}) *prop_type_change()*
272 Change properties of an existing text property type. If a 285 Change properties of an existing text property type. If a
273 property with this name does not exist an error is given. 286 property with this name does not exist an error is given.
274 The {props} argument is just like |prop_type_add()|. 287 The {props} argument is just like |prop_type_add()|.
275 288
276 See |text-properties| for information about text properties. 289 See |text-properties| for information about text properties.
277 290
291 Can also be used as a |method|: >
292 GetPropName()->prop_type_change(props)
278 293
279 prop_type_delete({name} [, {props}]) *prop_type_delete()* 294 prop_type_delete({name} [, {props}]) *prop_type_delete()*
280 Remove the text property type {name}. When text properties 295 Remove the text property type {name}. When text properties
281 using the type {name} are still in place, they will not have 296 using the type {name} are still in place, they will not have
282 an effect and can no longer be removed by name. 297 an effect and can no longer be removed by name.
287 302
288 When text property type {name} is not found there is no error. 303 When text property type {name} is not found there is no error.
289 304
290 See |text-properties| for information about text properties. 305 See |text-properties| for information about text properties.
291 306
307 Can also be used as a |method|: >
308 GetPropName()->prop_type_delete()
292 309
293 prop_type_get([{name} [, {props}]) *prop_type_get()* 310 prop_type_get([{name} [, {props}]) *prop_type_get()*
294 Returns the properties of property type {name}. This is a 311 Returns the properties of property type {name}. This is a
295 dictionary with the same fields as was given to 312 dictionary with the same fields as was given to
296 prop_type_add(). 313 prop_type_add().
300 {props} can contain a "bufnr" item. When it is given, use 317 {props} can contain a "bufnr" item. When it is given, use
301 this buffer instead of the global property types. 318 this buffer instead of the global property types.
302 319
303 See |text-properties| for information about text properties. 320 See |text-properties| for information about text properties.
304 321
322 Can also be used as a |method|: >
323 GetPropName()->prop_type_get()
305 324
306 prop_type_list([{props}]) *prop_type_list()* 325 prop_type_list([{props}]) *prop_type_list()*
307 Returns a list with all property type names. 326 Returns a list with all property type names.
308 327
309 {props} can contain a "bufnr" item. When it is given, use 328 {props} can contain a "bufnr" item. When it is given, use