patch 8.1.1429: "pos" option of popup window not supported yet

Problem:    "pos" option of popup window not supported yet.
Solution:   Implement the option. Rename popup_getposition() to
            popup_getpos().
This commit is contained in:
Bram Moolenaar
2019-05-30 21:24:26 +02:00
parent cc31ad9f9b
commit ac1f1bc222
5 changed files with 164 additions and 52 deletions

View File

@ -232,7 +232,8 @@ popup_setoptions({id}, {options}) *popup_setoptions()*
popup_getoptions({id}) *popup_getoptions()*
Return the {options} for popup {id} in a Dict.
A zero value means the option was not set.
A zero value means the option was not set. For "zindex" the
default value is returned, not zero.
The "highlight" entry is omitted, use the 'wincolor' option
for that: >
@ -240,7 +241,7 @@ popup_getoptions({id}) *popup_getoptions()*
< If popup window {id} is not found an empty Dict is returned.
popup_getposition({id}) *popup_getposition()*
popup_getpos({id}) *popup_getpos()*
Return the position and size of popup {id}. Returns a Dict
with these entries:
col screen column of the popup, one-based
@ -303,19 +304,22 @@ optionally text properties. It is in one of three forms:
|popup-props|.
The second argument of |popup_create()| is a dictionary with options:
line screen line where to position the popup; can use
"cursor", "cursor+1" or "cursor-1" to use the line of
the cursor and add or subtract a number of lines;
default is "cursor-1".
col screen column where to position the popup; can use
"cursor" to use the column of the cursor, "cursor+99"
and "cursor-99" to add or subtract a number of
columns; default is "cursor"
line screen line where to position the popup; can use a
number or "cursor", "cursor+1" or "cursor-1" to use
the line of the cursor and add or subtract a number of
lines; if omitted the popup is vertically centered,
otherwise "pos" is used.
col screen column where to position the popup; can use a
number or "cursor" to use the column of the cursor,
"cursor+99" and "cursor-99" to add or subtract a
number of columns; if omitted the popup is
horizontally centered, otherwise "pos" is used
pos "topleft", "topright", "botleft" or "botright":
defines what corner of the popup "line" and "col" are
used for. When not set "topleft" is used.
Alternatively "center" can be used to position the
popup in the center of the Vim window.
popup in the center of the Vim window, in which case
"line" and "col" are ignored.
{not implemented yet}
flip when TRUE (the default) and the position is relative
to the cursor, flip to below or above the cursor to