1
0
forked from aniani/vim

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 #4549)
            Also display a space for an empty popup.
This commit is contained in:
Bram Moolenaar
2019-06-16 15:32:14 +02:00
parent f85e40afc2
commit dc2ce58b5a
12 changed files with 192 additions and 34 deletions

View File

@@ -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