annotate runtime/doc/textprop.txt @ 29534:e491e48757d7 v9.0.0108

patch 9.0.0108: configure check for timer_create may give wrong error Commit: https://github.com/vim/vim/commit/5f6cae8b8a49c435556e32f84d067cd0b4d28e4c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 30 11:00:50 2022 +0100 patch 9.0.0108: configure check for timer_create may give wrong error Problem: Configure check for timer_create may give wrong error. Solution: Give a warning instead of an error.
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Jul 2022 12:15:07 +0200
parents 34c1f4cd0c18
children 14b139cbec49
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29314
f8116058ca76 release version 9.0
Bram Moolenaar <Bram@vim.org>
parents: 26242
diff changeset
1 *textprop.txt* For Vim version 9.0. Last change: 2021 Nov 23
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6
16610
1eaf34420bb3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 16553
diff changeset
7 Displaying text with properties attached. *textprop* *text-properties*
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 1. Introduction |text-prop-intro|
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 2. Functions |text-prop-functions|
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
12 3. When text changes |text-prop-changes|
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 {not able to use text properties when the |+textprop| feature was
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 disabled at compile time}
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 ==============================================================================
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 1. Introduction *text-prop-intro*
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 Text properties can be attached to text in a buffer. They will move with the
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 text: If lines are deleted or inserted the properties move with the text they
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 are attached to. Also when inserting/deleting text in the line before the
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 text property. And when inserting/deleting text inside the text property, it
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 will increase/decrease in size.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 The main use for text properties is to highlight text. This can be seen as a
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 replacement for syntax highlighting. Instead of defining patterns to match
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 the text, the highlighting is set by a script, possibly using the output of an
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 external parser. This only needs to be done once, not every time when
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 redrawing the screen, thus can be much faster, after the initial cost of
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 attaching the text properties.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 Text properties can also be used for other purposes to identify text. For
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 example, add a text property on a function name, so that a search can be
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 defined to jump to the next/previous function.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 A text property is attached at a specific line and column, and has a specified
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 length. The property can span multiple lines.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 A text property has these fields:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 "id" a number to be used as desired
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 "type" the name of a property type
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 Property Types ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 *E971*
18831
6848b809a26e Runtime file updates.
Bram Moolenaar <Bram@vim.org>
parents: 18615
diff changeset
48 A text property normally has the name of a property type, which defines
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 how to highlight the text. The property type can have these entries:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 "highlight" name of the highlight group to use
18615
c4cdc715cb68 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18594
diff changeset
51 "combine" when omitted or TRUE the text property highlighting is
c4cdc715cb68 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18594
diff changeset
52 combined with any syntax highlighting; when FALSE the
16545
7a563ee902b6 patch 8.1.1276: cannot combine text properties with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents: 15512
diff changeset
53 text property highlighting replaces the syntax
7a563ee902b6 patch 8.1.1276: cannot combine text properties with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents: 15512
diff changeset
54 highlighting
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 "priority" when properties overlap, the one with the highest
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 priority will be used.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 "start_incl" when TRUE inserts at the start position will be
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 included in the text property
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 "end_incl" when TRUE inserts at the end position will be
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 included in the text property
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 Example ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 Suppose line 11 in a buffer has this text (excluding the indent):
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 The number 123 is smaller than 4567.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68
15334
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15281
diff changeset
69 To highlight the numbers in this text: >
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 call prop_type_add('number', {'highlight': 'Constant'})
15194
8b334e4cb97f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15138
diff changeset
71 call prop_add(11, 12, {'length': 3, 'type': 'number'})
8b334e4cb97f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15138
diff changeset
72 call prop_add(11, 32, {'length': 4, 'type': 'number'})
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73
15334
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15281
diff changeset
74 Try inserting or deleting lines above the text, you will see that the text
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15281
diff changeset
75 properties stick to the text, thus the line number is adjusted as needed.
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15281
diff changeset
76
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 Setting "start_incl" and "end_incl" is useful when white space surrounds the
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 text, e.g. for a function name. Using false is useful when the text starts
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 and/or ends with a specific character, such as the quote surrounding a string.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 func FuncName(arg) ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 ^^^^^^^^ property with start_incl and end_incl set
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 var = "text"; ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 ^^^^^^ property with start_incl and end_incl not set
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 Nevertheless, when text is inserted or deleted the text may need to be parsed
15194
8b334e4cb97f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15138
diff changeset
88 and the text properties updated. But this can be done asynchronously.
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18016
diff changeset
90
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18016
diff changeset
91 Internal error *E967*
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18016
diff changeset
92
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18016
diff changeset
93 If you see E967, please report the bug. You can do this at Github:
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18016
diff changeset
94 https://github.com/vim/vim/issues/new
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18016
diff changeset
95
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 ==============================================================================
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 2. Functions *text-prop-functions*
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 Manipulating text property types:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 prop_type_add({name}, {props}) define a new property type
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 prop_type_change({name}, {props}) change an existing property type
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 prop_type_delete({name} [, {props}]) delete a property type
22723
5b7ea82bc18f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 21250
diff changeset
104 prop_type_get({name} [, {props}]) get property type values
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 prop_type_list([{props}]) get list of property types
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 Manipulating text properties:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 prop_add({lnum}, {col}, {props}) add a text property
25640
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
111 prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
112 add a text property at multiple
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
113 positions.
15281
97b40b4c6911 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15194
diff changeset
114 prop_clear({lnum} [, {lnum-end} [, {bufnr}]])
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 remove all text properties
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 prop_find({props} [, {direction}]) search for a text property
20241
56265f711890 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
117 prop_list({lnum} [, {props}]) text properties in {lnum}
15281
97b40b4c6911 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15194
diff changeset
118 prop_remove({props} [, {lnum} [, {lnum-end}]])
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 remove a text property
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
121 *prop_add()* *E965*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
122 prop_add({lnum}, {col}, {props})
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
123 Attach a text property at position {lnum}, {col}. {col} is
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
124 counted in bytes, use one for the first column.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
125 If {lnum} is invalid an error is given. *E966*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
126 If {col} is invalid an error is given. *E964*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
127
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
128 {props} is a dictionary with these fields:
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
129 length length of text in bytes, can only be used
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
130 for a property that does not continue in
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
131 another line; can be zero
24751
e69e7133c9cf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24278
diff changeset
132 end_lnum line number for the end of text (inclusive)
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
133 end_col column just after the text; not used when
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
134 "length" is present; when {col} and "end_col"
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
135 are equal, and "end_lnum" is omitted or equal
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
136 to {lnum}, this is a zero-width text property
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
137 bufnr buffer to add the property to; when omitted
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
138 the current buffer is used
19646
847a300aa244 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19601
diff changeset
139 id user defined ID for the property; must be a
29451
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
140 number, should be positive; when using "text"
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
141 then "id" must not be present and will be set
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
142 automatically to a negative number; otherwise
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
143 zero is used
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
144 text text to be displayed at {col}
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
145 type name of the text property type
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
146 All fields except "type" are optional.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
147
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
148 It is an error when both "length" and "end_lnum" or "end_col"
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
149 are given. Either use "length" or "end_col" for a property
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
150 within one line, or use "end_lnum" and "end_col" for a
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
151 property that spans more than one line.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
152 When neither "length" nor "end_col" are given the property
19523
a7a24d06d7ce Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
153 will be zero-width. That means it will move with the text, as
a7a24d06d7ce Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
154 a kind of mark. One character will be highlighted, if the
a7a24d06d7ce Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
155 type specifies highlighting.
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
156 The property can end exactly at the last character of the
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
157 text, or just after it. In the last case, if text is appended
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
158 to the line, the text property size will increase, also when
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
159 the property type does not have "end_incl" set.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
160
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
161 "type" will first be looked up in the buffer the property is
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
162 added to. When not found, the global property types are used.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
163 If not found an error is given.
29451
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
164 *virtual-text*
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
165 When "text" is used this text will be displayed at the start
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
166 location of the text property. The text of the buffer line
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
167 will be shifted to make room. This is called "virtual text".
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
168 The text will be displayed but it is not part of the actual
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
169 buffer line, the cursor cannot be placed on it. A mouse click
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
170 in the text will move the cursor to the first character after
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
171 the text.
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
172 A negative "id" will be chosen and is returned. Once a
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
173 property with "text" has been added for a buffer then using a
29533
34c1f4cd0c18 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29451
diff changeset
174 negative "id" for any other property will give an error:
34c1f4cd0c18 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29451
diff changeset
175 *E1293*
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
176
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
177 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
178 GetLnum()->prop_add(col, props)
25822
42723b535ab3 patch 8.2.3446: not enough tests for empty string arguments
Bram Moolenaar <Bram@vim.org>
parents: 25700
diff changeset
179 <
25640
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
180 *prop_add_list()*
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
181 prop_add_list({props}, [[{lnum}, {col}, {end-lnum}, {end-col}], ...])
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
182 Similar to prop_add(), but attaches a text property at
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
183 multiple positions in a buffer.
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
184
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
185 {props} is a dictionary with these fields:
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
186 bufnr buffer to add the property to; when omitted
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
187 the current buffer is used
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
188 id user defined ID for the property; must be a
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
189 number; when omitted zero is used
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
190 type name of the text property type
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
191 All fields except "type" are optional.
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
192
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
193 The second argument is a List of Lists where each list
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
194 specifies the starting and ending position of the text. The
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
195 first two items {lnum} and {col} specify the starting position
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
196 of the text where the property will be attached and the last
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
197 two items {end-lnum} and {end-col} specify the position just
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
198 after the text.
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
199
29451
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
200 It is not possible to add a text property with a "text" field
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
201 here.
057c26b5c33a patch 9.0.0067: cannot show virtual text
Bram Moolenaar <Bram@vim.org>
parents: 29314
diff changeset
202
25640
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
203 Example:
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
204 call prop_add_list(#{type: 'MyProp', id: 2},
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
205 \ [[1, 4, 1, 7],
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
206 \ [1, 15, 1, 20],
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
207 \ [2, 30, 3, 30]]
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
208
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
209 Can also be used as a |method|: >
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
210 GetProp()->prop_add_list([[1, 1, 1, 2], [1, 4, 1, 8]])
78ef12e0ce8c patch 8.2.3356: adding many text properties requires a lot of function calls
Bram Moolenaar <Bram@vim.org>
parents: 25392
diff changeset
211
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
212
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
213 prop_clear({lnum} [, {lnum-end} [, {props}]]) *prop_clear()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
214 Remove all text properties from line {lnum}.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
215 When {lnum-end} is given, remove all text properties from line
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
216 {lnum} to {lnum-end} (inclusive).
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
217
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
218 When {props} contains a "bufnr" item use this buffer,
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
219 otherwise use the current buffer.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
220
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
221 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
222 GetLnum()->prop_clear()
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
223 <
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
224 *prop_find()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
225 prop_find({props} [, {direction}])
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
226 Search for a text property as specified with {props}:
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
227 id property with this ID
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
228 type property with this type name
24252
7422f2f719a3 patch 8.2.2667: prop_find() cannot find item matching both id and type
Bram Moolenaar <Bram@vim.org>
parents: 22723
diff changeset
229 both "id" and "type" must both match
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
230 bufnr buffer to search in; when present a
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
231 start position with "lnum" and "col"
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
232 must be given; when omitted the
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
233 current buffer is used
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
234 lnum start in this line (when omitted start
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
235 at the cursor)
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
236 col start at this column (when omitted
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
237 and "lnum" is given: use column 1,
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
238 otherwise start at the cursor)
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
239 skipstart do not look for a match at the start
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
240 position
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
241
24252
7422f2f719a3 patch 8.2.2667: prop_find() cannot find item matching both id and type
Bram Moolenaar <Bram@vim.org>
parents: 22723
diff changeset
242 A property matches when either "id" or "type" matches.
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
243 {direction} can be "f" for forward and "b" for backward. When
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
244 omitted forward search is performed.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
245
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
246 If a match is found then a Dict is returned with the entries
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
247 as with prop_list(), and additionally an "lnum" entry.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
248 If no match is found then an empty Dict is returned.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
249
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
250
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
251 prop_list({lnum} [, {props}]) *prop_list()*
26242
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
252 Returns a List with all the text properties in line {lnum}.
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
253
26242
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
254 The following optional items are supported in {props}:
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
255 bufnr use this buffer instead of the current buffer
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
256 end_lnum return text properties in all the lines
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
257 between {lnum} and {end_lnum} (inclusive).
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
258 A negative value is used as an offset from the
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
259 last buffer line; -1 refers to the last buffer
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
260 line.
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
261 types List of property type names. Return only text
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
262 properties that match one of the type names.
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
263 ids List of property identifiers. Return only text
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
264 properties with one of these identifiers.
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
265
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
266 The properties are ordered by starting column and priority.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
267 Each property is a Dict with these entries:
26242
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
268 lnum starting line number. Present only when
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
269 returning text properties between {lnum} and
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
270 {end_lnum}.
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
271 col starting column
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
272 length length in bytes, one more if line break is
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
273 included
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
274 id property ID
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
275 type name of the property type, omitted if
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
276 the type was deleted
25392
b427a26b0210 patch 8.2.3233: prop_list() and prop_find() do not indicate the buffer
Bram Moolenaar <Bram@vim.org>
parents: 24751
diff changeset
277 type_bufnr buffer number for which this type was defined;
b427a26b0210 patch 8.2.3233: prop_list() and prop_find() do not indicate the buffer
Bram Moolenaar <Bram@vim.org>
parents: 24751
diff changeset
278 0 if the type is global
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
279 start when TRUE property starts in this line
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
280 end when TRUE property ends in this line
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
281
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
282 When "start" is zero the property started in a previous line,
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
283 the current one is a continuation.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
284 When "end" is zero the property continues in the next line.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
285 The line break after this line is included.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
286
26242
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
287 Returns an empty list on error.
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
288
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
289 Examples:
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
290 " get text properties placed in line 5
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
291 echo prop_list(5)
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
292 " get text properties placed in line 20 in buffer 4
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
293 echo prop_list(20, {'bufnr': 4})
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
294 " get all the text properties between line 1 and 20
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
295 echo prop_list(1, {'end_lnum': 20})
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
296 " get all the text properties of type 'myprop'
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
297 echo prop_list(1, {'types': ['myprop'],
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
298 \ 'end_lnum': -1})
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
299 " get all the text properties of type 'prop1' or 'prop2'
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
300 echo prop_list(1, {'types': ['prop1', 'prop2'],
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
301 \ 'end_lnum': -1})
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
302 " get all the text properties with ID 8
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
303 echo prop_list(1, {'ids': [8], 'end_lnum': line('$')})
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
304 " get all the text properties with ID 10 and 20
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
305 echo prop_list(1, {'ids': [10, 20], 'end_lnum': -1})
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
306 " get text properties with type 'myprop' and ID 100
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
307 " in buffer 4.
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
308 echo prop_list(1, {'bufnr': 4, 'types': ['myprop'],
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
309 \ 'ids': [100], 'end_lnum': -1})
685206b54ecf patch 8.2.3652: can only get text properties one line at a time
Bram Moolenaar <Bram@vim.org>
parents: 25822
diff changeset
310
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
311 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
312 GetLnum()->prop_list()
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
313 <
21250
21fb2a3ad3ca Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20241
diff changeset
314 *prop_remove()* *E968* *E860*
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
315 prop_remove({props} [, {lnum} [, {lnum-end}]])
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
316 Remove a matching text property from line {lnum}. When
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
317 {lnum-end} is given, remove matching text properties from line
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
318 {lnum} to {lnum-end} (inclusive).
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
319 When {lnum} is omitted remove matching text properties from
24751
e69e7133c9cf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24278
diff changeset
320 all lines (this requires going over all lines, thus will be a
e69e7133c9cf Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 24278
diff changeset
321 bit slow for a buffer with many lines).
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
322
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
323 {props} is a dictionary with these fields:
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
324 id remove text properties with this ID
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
325 type remove text properties with this type name
19601
67f39cb0a49c patch 8.2.0357: cannot delete a text property matching both id and type
Bram Moolenaar <Bram@vim.org>
parents: 19523
diff changeset
326 both "id" and "type" must both match
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
327 bufnr use this buffer instead of the current one
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
328 all when TRUE remove all matching text properties,
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
329 not just the first one
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
330 A property matches when either "id" or "type" matches.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
331 If buffer "bufnr" does not exist you get an error message.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
332 If buffer "bufnr" is not loaded then nothing happens.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
333
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
334 Returns the number of properties that were removed.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
335
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
336 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
337 GetProps()->prop_remove()
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
338
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
339
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
340 prop_type_add({name}, {props}) *prop_type_add()* *E969* *E970*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
341 Add a text property type {name}. If a property type with this
17909
cc953757ed2a Runtime files update.
Bram Moolenaar <Bram@vim.org>
parents: 17758
diff changeset
342 name already exists an error is given. Nothing is returned.
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
343 {props} is a dictionary with these optional fields:
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
344 bufnr define the property only for this buffer; this
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
345 avoids name collisions and automatically
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
346 clears the property types when the buffer is
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
347 deleted.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
348 highlight name of highlight group to use
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
349 priority when a character has multiple text
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
350 properties the one with the highest priority
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
351 will be used; negative values can be used, the
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
352 default priority is zero
24278
4ab4ef0c48b1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 24252
diff changeset
353 combine when omitted or TRUE combine the highlight
4ab4ef0c48b1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 24252
diff changeset
354 with any syntax highlight; when FALSE syntax
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
355 highlight will not be used
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
356 start_incl when TRUE inserts at the start position will
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
357 be included in the text property
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
358 end_incl when TRUE inserts at the end position will be
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
359 included in the text property
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
360
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
361 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
362 GetPropName()->prop_type_add(props)
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
363
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
364 prop_type_change({name}, {props}) *prop_type_change()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
365 Change properties of an existing text property type. If a
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
366 property with this name does not exist an error is given.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
367 The {props} argument is just like |prop_type_add()|.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
368
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
369 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
370 GetPropName()->prop_type_change(props)
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
371
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
372 prop_type_delete({name} [, {props}]) *prop_type_delete()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
373 Remove the text property type {name}. When text properties
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
374 using the type {name} are still in place, they will not have
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
375 an effect and can no longer be removed by name.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
376
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
377 {props} can contain a "bufnr" item. When it is given, delete
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
378 a property type from this buffer instead of from the global
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
379 property types.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
380
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
381 When text property type {name} is not found there is no error.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
382
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
383 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
384 GetPropName()->prop_type_delete()
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
385
22723
5b7ea82bc18f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 21250
diff changeset
386 prop_type_get({name} [, {props}]) *prop_type_get()*
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
387 Returns the properties of property type {name}. This is a
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
388 dictionary with the same fields as was given to
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
389 prop_type_add().
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
390 When the property type {name} does not exist, an empty
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
391 dictionary is returned.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
392
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
393 {props} can contain a "bufnr" item. When it is given, use
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
394 this buffer instead of the global property types.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
395
17980
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
396 Can also be used as a |method|: >
52f23198af7f patch 8.1.1986: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 17909
diff changeset
397 GetPropName()->prop_type_get()
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
398
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
399 prop_type_list([{props}]) *prop_type_list()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
400 Returns a list with all property type names.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
401
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
402 {props} can contain a "bufnr" item. When it is given, use
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
403 this buffer instead of the global property types.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
404
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
405
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
406 ==============================================================================
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
407 3. When text changes *text-prop-changes*
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
408
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
409 Vim will do its best to keep the text properties on the text where it was
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
410 attached. When inserting or deleting text the properties after the change
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
411 will move accordingly.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
412
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
413 When text is deleted and a text property no longer includes any text, it is
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
414 deleted. However, a text property that was defined as zero-width will remain,
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
415 unless the whole line is deleted.
18016
834b7854aa3c Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 17980
diff changeset
416 *E275*
17694
6f9cde96ee3c patch 8.1.1844: buffer no longer unloaded when adding text properties
Bram Moolenaar <Bram@vim.org>
parents: 17456
diff changeset
417 When a buffer is unloaded, all the text properties are gone. There is no way
6f9cde96ee3c patch 8.1.1844: buffer no longer unloaded when adding text properties
Bram Moolenaar <Bram@vim.org>
parents: 17456
diff changeset
418 to store the properties in a file. You can only re-create them. When a
6f9cde96ee3c patch 8.1.1844: buffer no longer unloaded when adding text properties
Bram Moolenaar <Bram@vim.org>
parents: 17456
diff changeset
419 buffer is hidden the text is preserved and so are the text properties. It is
6f9cde96ee3c patch 8.1.1844: buffer no longer unloaded when adding text properties
Bram Moolenaar <Bram@vim.org>
parents: 17456
diff changeset
420 not possible to add text properties to an unloaded buffer.
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
421
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
422 When using replace mode, the text properties stay on the same character
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
423 positions, even though the characters themselves change.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
424
16808
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
425 To update text properties after the text was changed, install a callback with
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
426 `listener_add()`. E.g, if your plugin does spell checking, you can have the
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
427 callback update spelling mistakes in the changed text. Vim will move the
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
428 properties below the changed text, so that they still highlight the same text,
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
429 thus you don't need to update these.
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
430
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
431
19523
a7a24d06d7ce Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
432 Text property columns are not updated or copied: ~
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
433
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
434 - When setting the line with |setline()| or through an interface, such as Lua,
16610
1eaf34420bb3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 16553
diff changeset
435 Tcl or Python. Vim does not know what text got inserted or deleted.
19523
a7a24d06d7ce Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 19116
diff changeset
436 - With a command like `:move`, which takes a line of text out of context.
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
437
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
438
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
439 vim:tw=78:ts=8:noet:ft=help:norl: