summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-16 15:32:14 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-16 15:32:14 +0200
commitdc2ce58b5ac72e2af765385eb426660104816344 (patch)
tree6578f1464f46fcc647b85cd32f7eda44d7365c86 /runtime
parentf85e40afc204c241c6a01023be3e7b8101d36367 (diff)
patch 8.1.1553: not easy to change the text in a popup windowv8.1.1553
Problem: Not easy to change the text in a popup window. Solution: Add popup_settext(). (Ben Jackson, closes #4549) Also display a space for an empty popup.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/popup.txt26
1 files changed, 20 insertions, 6 deletions
diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt
index a9f55be279..02c66c3b30 100644
--- 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}) *popup_setoptions()*
{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()| is a dictionary with options:
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()| is a dictionary with options:
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