summaryrefslogtreecommitdiffstats
path: root/runtime/doc/textprop.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/textprop.txt')
-rw-r--r--runtime/doc/textprop.txt39
1 files changed, 23 insertions, 16 deletions
diff --git a/runtime/doc/textprop.txt b/runtime/doc/textprop.txt
index 5fb53aff12..5a849fed69 100644
--- a/runtime/doc/textprop.txt
+++ b/runtime/doc/textprop.txt
@@ -1,4 +1,4 @@
-*textprop.txt* For Vim version 9.0. Last change: 2022 Sep 17
+*textprop.txt* For Vim version 9.0. Last change: 2022 Sep 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -143,10 +143,11 @@ prop_add({lnum}, {col}, {props})
automatically to a negative number; otherwise
zero is used
*E1305*
- text text to be displayed before {col}, or after the
- line if {col} is zero; prepend and/or append
- spaces for padding with highlighting; cannot
- be used with "length", "end_lnum" and "end_col"
+ text text to be displayed before {col}, or
+ above/below the line if {col} is zero; prepend
+ and/or append spaces for padding with
+ highlighting; cannot be used with "length",
+ "end_lnum" and "end_col" |virtual-text|
*E1294*
text_align when "text" is present and {col} is zero;
specifies where to display the text:
@@ -191,12 +192,23 @@ prop_add({lnum}, {col}, {props})
If not found an error is given.
*virtual-text*
When "text" is used and the column is non-zero then this text
- will be displayed at the start location of the text property
- after the text. The text of the buffer line will be shifted
- to make room. This is called "virtual text".
- When the column is zero the virtual text will appear after the
- buffer text. The "text_align" and "text_wrap" arguments
- determine how it is displayed.
+ will be displayed at the specified start location of the text
+ property. The text of the buffer line will be shifted to make
+ room. This is called "virtual text".
+ When the column is zero the virtual text will appear above,
+ after or below the buffer text. The "text_align" and
+ "text_wrap" arguments determine how it is displayed.
+ To separate the virtual text from the buffer text prepend
+ and/or append spaces to the "text" field or use the
+ "text_padding_left" value.
+
+ Make sure to use a highlight that makes clear to the user that
+ this is virtual text, otherwise it will be very confusing that
+ the text cannot be edited. When using "above" you need to
+ make clear this text belongs to the text line below it, when
+ using "below" you need to make sure it belongs to the text
+ line above it.
+
The text will be displayed but it is not part of the actual
buffer line, the cursor cannot be placed on it. A mouse click
in the text will move the cursor to the first character after
@@ -208,11 +220,6 @@ prop_add({lnum}, {col}, {props})
property with "text" has been added for a buffer then using a
negative "id" for any other property will give an error:
*E1293*
- Make sure to use a highlight that makes clear to the user that
- this is virtual text, otherwise it will be very confusing that
- the text cannot be edited.
- To separate the virtual text from the buffer text prepend
- and/or append spaces to the "text" field.
Can also be used as a |method|: >
GetLnum()->prop_add(col, props)