diff runtime/doc/popup.txt @ 17162:f16cee6adf29 v8.1.1580

patch 8.1.1580: cannot make part of a popup transparent commit https://github.com/vim/vim/commit/c662ec9978e9a381680ffe53d05da0e10bb8d1a0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 23 00:15:57 2019 +0200 patch 8.1.1580: cannot make part of a popup transparent Problem: Cannot make part of a popup transparent. Solution: Add the "mask" option.
author Bram Moolenaar <Bram@vim.org>
date Sun, 23 Jun 2019 00:30:04 +0200
parents 9ccb1ea9b2fc
children 23609a6d8cc7
line wrap: on
line diff
--- a/runtime/doc/popup.txt
+++ b/runtime/doc/popup.txt
@@ -112,7 +112,6 @@ TODO:
   How to add highlighting?
 - Implement:
 	flip option
-	transparent area, to minimize covering text.  Define rectangles?
 
 ==============================================================================
 2. Functions						*popup-functions*
@@ -372,6 +371,7 @@ popup_setoptions({id}, {options})			*pop
 			borderhighlight
 			borderchars
 			zindex
+			mask
 			time
 			moved
 			filter
@@ -527,6 +527,8 @@ The second argument of |popup_create()| 
 			otherwise ASCII characters are used.
 	zindex		Priority for the popup, default 50.  Minimum value is
 			1, maximum value is 32000.
+	mask		A list of lists with coordinates, defining parts of
+			the popup that are transparent.  See |popup-mask|.
 	time		Time in milliseconds after which the popup will close.
 			When omitted |popup_close()| must be used.
 	moved		Specifies to close the popup if the cursor moved:
@@ -557,7 +559,6 @@ These are similar to the third argument 
 - "lnum" is always the current line in the list
 - "bufnr" is always the buffer of the popup
 - "col" is in the Dict instead of a separate argument
-- "transparent" is extra
 So we get:
 	col		starting column, counted in bytes, use one for the
 			first column.
@@ -570,10 +571,6 @@ So we get:
 			used
 	type		name of the text property type, as added with
 			|prop_type_add()|
-	transparent	do not show these characters, show the text under it;
-			if there is a border character to the right or below
-			it will be made transparent as well
-			{not implemented yet}
 
 
 POPUP FILTER						*popup-filter*
@@ -632,6 +629,26 @@ the second argument of `popup_close()`.
 If the popup is force-closed, e.g. because the cursor moved or CTRL-C was
 pressed, the number -1 is passed to the callback.
 
+
+POPUP MASK						*popup-mask*
+
+To minimize the text that the popup covers, parts of it can be made
+transparent.  This is defined by a "mask" which is a list of lists, where each
+list has four numbers:
+    col		start column, positive for counting from the left, 1 for
+		leftmost, negative for counting from the right, -1 for
+		rightmost
+    endcol	last column, like "col"
+    line	start line, positive for conting from the top, 1 for top,
+		negative for counting from the bottom, -1 for bottom
+    endline	end line, like "line"
+
+For example, to make the last 10 columns of the last line transparent:
+	[[-10, -1, -1, -1]]
+
+To make the four corners transparent:
+	[[1, 1, 1, 1], [-1, -1, 1, 1], [1, 1, -1, -1], [-1, -1, -1, -1]]
+
 ==============================================================================
 3. Examples						*popup-examples*