annotate runtime/doc/textprop.txt @ 17456:e414281d8bb4 v8.1.1726

patch 8.1.1726: the eval.txt help file is too big commit https://github.com/vim/vim/commit/ed997adaa1e9bd057ce732a73d933b739e9d0c30 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 21 16:42:00 2019 +0200 patch 8.1.1726: the eval.txt help file is too big Problem: The eval.txt help file is too big. Solution: Split off testing support to testing.txt. Move function details to where the functionality is explained.
author Bram Moolenaar <Bram@vim.org>
date Sun, 21 Jul 2019 16:45:05 +0200
parents 9ccb1ea9b2fc
children 6f9cde96ee3c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
1 *textprop.txt* For Vim version 8.1. Last change: 2019 Jul 20
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 THIS IS UNDER DEVELOPMENT - ANYTHING MAY STILL CHANGE *E967*
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 What is not working yet:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 - Adjusting column/length when inserting text
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 - Text properties spanning more than one line
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 - prop_find()
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 1. Introduction |text-prop-intro|
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 2. Functions |text-prop-functions|
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
19 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
20
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 {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
23 disabled at compile time}
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 ==============================================================================
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 1. Introduction *text-prop-intro*
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 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
29 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
30 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
31 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
32 will increase/decrease in size.
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 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
35 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
36 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
37 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
38 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
39 attaching the text properties.
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 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
42 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
43 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
44
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 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
46 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
47
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 A text property has these fields:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 "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
50 "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
51
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 Property Types ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 *E971*
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 A text property normally has the name of a property type, which defines
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 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
57 "highlight" name of the highlight group to use
16545
7a563ee902b6 patch 8.1.1276: cannot combine text properties with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents: 15512
diff changeset
58 "combine" when TRUE the text property highlighting is combined
17161
9ccb1ea9b2fc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 16808
diff changeset
59 with any syntax highlighting, when omitted or FALSE the
16545
7a563ee902b6 patch 8.1.1276: cannot combine text properties with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents: 15512
diff changeset
60 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
61 highlighting
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 "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
63 priority will be used.
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 "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
65 included in the text property
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 "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
67 included in the text property
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 Example ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 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
73
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 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
75
15334
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15281
diff changeset
76 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
77 call prop_type_add('number', {'highlight': 'Constant'})
15194
8b334e4cb97f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15138
diff changeset
78 call prop_add(11, 12, {'length': 3, 'type': 'number'})
8b334e4cb97f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15138
diff changeset
79 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
80
15334
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15281
diff changeset
81 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
82 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
83
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 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
85 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
86 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
87
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 func FuncName(arg) ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 ^^^^^^^^ 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
90
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 var = "text"; ~
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 ^^^^^^ 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
93
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 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
95 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
96
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 ==============================================================================
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 2. Functions *text-prop-functions*
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 Manipulating text property types:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 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
103 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
104 prop_type_delete({name} [, {props}]) delete a property type
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 prop_type_get([{name} [, {props}]) get property type values
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 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
107
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 Manipulating text properties:
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 prop_add({lnum}, {col}, {props}) add a text property
15281
97b40b4c6911 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15194
diff changeset
112 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
113 remove all text properties
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 prop_find({props} [, {direction}]) search for a text property
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 prop_list({lnum} [, {props}) text properties in {lnum}
15281
97b40b4c6911 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15194
diff changeset
116 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
117 remove a text property
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118
17456
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
119 *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
120 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
121 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
122 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
123 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
124 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
125
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
126 {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
127 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
128 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
129 another line; can be zero
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
130 end_lnum line number for the end of text
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
131 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
132 "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
133 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
134 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
135 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
136 the 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
137 id user defined ID for the property; 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 zero is used
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
139 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
140 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
141
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
142 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
143 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
144 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
145 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
146 When neither "length" nor "end_col" are given the property
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
147 will be zero-width. That means it will not be highlighted but
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
148 will move with the text, as a kind of mark.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
149 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
150 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
151 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
152 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
153
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
154 "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
155 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
156 If not found 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
157
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
158 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
159
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 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
162 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
163 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
164 {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
165
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
166 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
167 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
168
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
169 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
170
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
171 *prop_find()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
172 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
173 NOT IMPLEMENTED YET
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
174 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
175 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
176 type property with this type name
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
177 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
178 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
179 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
180 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
181 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
182 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
183 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
184 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
185 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
186 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
187 position
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
188
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
189 {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
190 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
191
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
192 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
193 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
194 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
195
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
196 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
197
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
198
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
199 prop_list({lnum} [, {props}]) *prop_list()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
200 Return a List with all text properties in line {lnum}.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
201
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
202 When {props} contains a "bufnr" item, use this buffer instead
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
203 of 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
204
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
205 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
206 Each property is a Dict with these entries:
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
207 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
208 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
209 included
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
210 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
211 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
212 the type was deleted
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
213 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
214 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
215
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
216 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
217 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
218 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
219 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
220
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
221 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
222
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
223
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
224 *prop_remove()* *E968*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
225 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
226 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
227 {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
228 {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
229 When {lnum} is omitted remove matching text properties from
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
230 all lines.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
231
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
232 {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
233 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
234 type remove text properties with this type name
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
235 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
236 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
237 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
238 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
239 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
240 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
241
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
242 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
243
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
244 See |text-properties| for information about text properties.
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
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
247 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
248 Add a text property type {name}. If a property type with this
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
249 name already exists 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
250 {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
251 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
252 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
253 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
254 deleted.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
255 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
256 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
257 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
258 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
259 default priority is zero
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
260 combine when TRUE combine the highlight with any
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
261 syntax highlight; when omitted or FALSE syntax
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
262 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
263 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
264 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
265 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
266 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
267
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
268 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
269
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
270
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
271 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
272 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
273 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
274 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
275
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
276 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
277
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
278
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
279 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
280 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
281 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
282 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
283
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
284 {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
285 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
286 property types.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
287
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
288 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
289
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
290 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
291
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
292
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
293 prop_type_get([{name} [, {props}]) *prop_type_get()*
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
294 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
295 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
296 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
297 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
298 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
299
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
300 {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
301 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
302
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
303 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
304
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
305
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
306 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
307 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
308
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
309 {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
310 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
311
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
312 See |text-properties| for information about text properties.
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
313
e414281d8bb4 patch 8.1.1726: the eval.txt help file is too big
Bram Moolenaar <Bram@vim.org>
parents: 17161
diff changeset
314
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
315 ==============================================================================
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
316 3. When text changes *text-prop-changes*
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
317
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
318 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
319 attached. When inserting or deleting text the properties after the change
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
320 will move accordingly.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
321
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
322 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
323 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
324 unless the whole line is deleted.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
325
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
326 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
327 positions, even though the characters themselves change.
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
328
16808
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
329 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
330 `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
331 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
332 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
333 thus you don't need to update these.
c002c4899529 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 16610
diff changeset
334
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
335
16610
1eaf34420bb3 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 16553
diff changeset
336 Text property columns are not updated: ~
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
337
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
338 - 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
339 Tcl or Python. Vim does not know what text got inserted or deleted.
15512
f0f06837a699 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
340
15138
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
341
9df130fd5e0d patch 8.1.0579: cannot attach properties to text
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
342 vim:tw=78:ts=8:noet:ft=help:norl: