diff runtime/doc/popup.txt @ 17107:0001d10a7661 v8.1.1553

patch 8.1.1553: not easy to change the text in a popup window commit https://github.com/vim/vim/commit/dc2ce58b5ac72e2af765385eb426660104816344 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 16 15:32:14 2019 +0200 patch 8.1.1553: not easy to change the text in a popup window Problem: Not easy to change the text in a popup window. Solution: Add popup_settext(). (Ben Jackson, closes https://github.com/vim/vim/issues/4549) Also display a space for an empty popup.
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Jun 2019 15:45:05 +0200
parents 94007c802045
children 7ef5283ace3c
line wrap: on
line diff
--- a/runtime/doc/popup.txt
+++ b/runtime/doc/popup.txt
@@ -104,15 +104,18 @@ TODO:
   incomplete cell.
 - Can the buffer be re-used, to avoid using up lots of buffer numbers?
 - Use a popup window for the "info" item of completion instead of using a
-  preview window.
+  preview window.  Ideas in issue #4544.
+  How to add highlighting?
+- When the lines do not fit show a scrollbar (like in the popup menu).
+  Use the mouse wheel for scrolling.
 - Implement:
 	popup_filter_menu({id}, {key})
 	popup_menu({text}, {options})
 	popup_setoptions({id}, {options})
-	flip option
 	hidden option
 	tabpage option with number
 	title option
+	flip option
 	transparent text property
 
 
@@ -134,6 +137,7 @@ Manipulating a popup window:
 	|popup_show()|		show a previously hidden popup
 	|popup_move()|		change the position and size of a popup
 	|popup_setoptions()|	override options of a popup
+	|popup_settext()|	replace the popup buffer contents
 
 Closing popup windows:
 	|popup_close()|		close one popup
@@ -330,6 +334,11 @@ popup_setoptions({id}, {options})			*pop
 		{not implemented yet}
 		Override options in popup {id} with entries in {options}.
 
+popup_settext({id}, {text})				*popup_settext()*
+		Set the text of the buffer in poup win {id}. {text} is the
+		same as supplied to |popup_create()|.
+		Does not change the window size or position, other than caused
+		by the different text.
 
 
 POPUP BUFFER AND WINDOW					*popup-buffer*
@@ -365,8 +374,9 @@ need them.
 
 POPUP_CREATE() ARGUMENTS				*popup_create-usage*
 
-The first argument of |popup_create()| specifies the text to be displayed, and
-optionally text properties.  It is in one of three forms:
+The first argument of |popup_create()| (and the second argument to
+|popup_setttext()|) specifies the text to be displayed, and optionally text
+properties.  It is in one of three forms:
 - a string
 - a list of strings
 - a list of dictionaries, where each dictionary has these entries:
@@ -404,7 +414,9 @@ The second argument of |popup_create()| 
 	flip		When TRUE (the default) and the position is relative
 			to the cursor, flip to below or above the cursor to
 			avoid overlap with the |popupmenu-completion| or
-			another popup with a higher "zindex".
+			another popup with a higher "zindex".  When there is
+			no space above/below the cursor then show the popup to
+			the side of the popup or popup menu.
 			{not implemented yet}
 	maxheight	Maximum height of the contents, excluding border and
 			padding.
@@ -434,7 +446,9 @@ The second argument of |popup_create()| 
 	wrap		TRUE to make the lines wrap (default TRUE).
 	drag		TRUE to allow the popup to be dragged with the mouse
 			by grabbing at at the border.  Has no effect if the
-			popup does not have a border.
+			popup does not have a border. As soon as dragging
+			starts and "pos" is "center" it is changed to
+			"topleft".
 	highlight	Highlight group name to use for the text, stored in
 			the 'wincolor' option.
 	padding		List with numbers, defining the padding