Mercurial > vim
comparison runtime/doc/textprop.txt @ 30547:1e91e26ceebf
Update runtime files
Commit: https://github.com/vim/vim/commit/9fbdbb814f4ad67a14979aba4a6a49800c2f1a99
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 27 17:30:34 2022 +0100
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 27 Sep 2022 18:45:05 +0200 |
parents | 0827d3d6d8c0 |
children | f4956427ee9e |
comparison
equal
deleted
inserted
replaced
30546:3107cc41afc2 | 30547:1e91e26ceebf |
---|---|
1 *textprop.txt* For Vim version 9.0. Last change: 2022 Sep 17 | 1 *textprop.txt* For Vim version 9.0. Last change: 2022 Sep 21 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
141 number, should be positive; when using "text" | 141 number, should be positive; when using "text" |
142 then "id" must not be present and will be set | 142 then "id" must not be present and will be set |
143 automatically to a negative number; otherwise | 143 automatically to a negative number; otherwise |
144 zero is used | 144 zero is used |
145 *E1305* | 145 *E1305* |
146 text text to be displayed before {col}, or after the | 146 text text to be displayed before {col}, or |
147 line if {col} is zero; prepend and/or append | 147 above/below the line if {col} is zero; prepend |
148 spaces for padding with highlighting; cannot | 148 and/or append spaces for padding with |
149 be used with "length", "end_lnum" and "end_col" | 149 highlighting; cannot be used with "length", |
150 "end_lnum" and "end_col" |virtual-text| | |
150 *E1294* | 151 *E1294* |
151 text_align when "text" is present and {col} is zero; | 152 text_align when "text" is present and {col} is zero; |
152 specifies where to display the text: | 153 specifies where to display the text: |
153 after after the end of the line | 154 after after the end of the line |
154 right right aligned in the window (unless | 155 right right aligned in the window (unless |
189 "type" will first be looked up in the buffer the property is | 190 "type" will first be looked up in the buffer the property is |
190 added to. When not found, the global property types are used. | 191 added to. When not found, the global property types are used. |
191 If not found an error is given. | 192 If not found an error is given. |
192 *virtual-text* | 193 *virtual-text* |
193 When "text" is used and the column is non-zero then this text | 194 When "text" is used and the column is non-zero then this text |
194 will be displayed at the start location of the text property | 195 will be displayed at the specified start location of the text |
195 after the text. The text of the buffer line will be shifted | 196 property. The text of the buffer line will be shifted to make |
196 to make room. This is called "virtual text". | 197 room. This is called "virtual text". |
197 When the column is zero the virtual text will appear after the | 198 When the column is zero the virtual text will appear above, |
198 buffer text. The "text_align" and "text_wrap" arguments | 199 after or below the buffer text. The "text_align" and |
199 determine how it is displayed. | 200 "text_wrap" arguments determine how it is displayed. |
201 To separate the virtual text from the buffer text prepend | |
202 and/or append spaces to the "text" field or use the | |
203 "text_padding_left" value. | |
204 | |
205 Make sure to use a highlight that makes clear to the user that | |
206 this is virtual text, otherwise it will be very confusing that | |
207 the text cannot be edited. When using "above" you need to | |
208 make clear this text belongs to the text line below it, when | |
209 using "below" you need to make sure it belongs to the text | |
210 line above it. | |
211 | |
200 The text will be displayed but it is not part of the actual | 212 The text will be displayed but it is not part of the actual |
201 buffer line, the cursor cannot be placed on it. A mouse click | 213 buffer line, the cursor cannot be placed on it. A mouse click |
202 in the text will move the cursor to the first character after | 214 in the text will move the cursor to the first character after |
203 the text, or the last character of the line. | 215 the text, or the last character of the line. |
204 Any Tab and other control character in the text will be | 216 Any Tab and other control character in the text will be |
206 is difficult to compute). | 218 is difficult to compute). |
207 A negative "id" will be chosen and is returned. Once a | 219 A negative "id" will be chosen and is returned. Once a |
208 property with "text" has been added for a buffer then using a | 220 property with "text" has been added for a buffer then using a |
209 negative "id" for any other property will give an error: | 221 negative "id" for any other property will give an error: |
210 *E1293* | 222 *E1293* |
211 Make sure to use a highlight that makes clear to the user that | |
212 this is virtual text, otherwise it will be very confusing that | |
213 the text cannot be edited. | |
214 To separate the virtual text from the buffer text prepend | |
215 and/or append spaces to the "text" field. | |
216 | 223 |
217 Can also be used as a |method|: > | 224 Can also be used as a |method|: > |
218 GetLnum()->prop_add(col, props) | 225 GetLnum()->prop_add(col, props) |
219 < | 226 < |
220 *prop_add_list()* | 227 *prop_add_list()* |