Skip to main content
Module

x/denops_std/function/vim/mod.ts>PopupCreateOptions

📚 Standard module for denops.vim
Go to Latest
interface PopupCreateOptions
import { type PopupCreateOptions } from "https://deno.land/x/denops_std@v6.4.0/function/vim/mod.ts";

Properties

optional
line: number | string

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 or zero the popup is vertically centered. The first line is 1. When using "textprop" the number is relative to the text property and can be negative.

optional
col: number | string

Screen column where to position the popup. Can use a number or "cursor" to use the column of the cursor, "cursor+9" or "cursor-9" to add or subtract a number of columns. If omitted or zero the popup is horizontally centered. The first column is 1. When using "textprop" the number is relative to the text property and can be negative.

optional
pos:
| "topleft"
| "topright"
| "botleft"
| "botright"
| "center"

"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, in which case "line" and "col" are ignored.

optional
posinvert: boolean

When FALSE the value of "pos" is always used. When TRUE (the default) and the popup does not fit vertically and there is more space on the other side then the popup is placed on the other side of the position indicated by "line".

optional
textprop: string

When present the popup is positioned next to a text property with this name and will move when the text property moves. Use an empty string to remove. See popup-textprop-pos.

optional
textpropwin: number

What window to search for the text property. When omitted or invalid the current window is used. Used when "textprop" is present.

optional
textpropid: number

Used to identify the text property when "textprop" is present. Use zero to reset.

optional
fixed: boolean

When FALSE (the default), and:

  • "pos" is "botleft" or "topleft", and
  • "wrap" is off, and
  • the popup would be truncated at the right edge of the screen, then the popup is moved to the left so as to fit the contents on the screen. Set to TRUE to disable this.
optional
flip: boolean

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". 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}

optional
maxheight: number

Maximum height of the contents, excluding border and padding.

optional
minheight: number

Minimum height of the contents, excluding border and padding.

optional
maxwidth: number

Maximum width of the contents, excluding border, padding and scrollbar.

optional
minwidth: number

Minimum width of the contents, excluding border, padding and scrollbar.

optional
firstline: number

First buffer line to display. When larger than one it looks like the text scrolled up. When out of range the last buffer line will at the top of the window. Set to zero to leave the position as set by commands. Also see "scrollbar".

optional
hidden: boolean

When TRUE the popup exists but is not displayed; use popup_show() to unhide it.

optional
tabpage: number

When -1: display the popup on all tab pages. When 0 (the default): display the popup on the current tab page. Otherwise the number of the tab page the popup is displayed on; when invalid the popup is not created and an error is given. E997

optional
title: string

Text to be displayed above the first item in the popup, on top of any border. If there is no top border one line of padding is added to put the title on. You might want to add one or more spaces at the start and end as padding.

optional
wrap: boolean

TRUE to make the lines wrap (default TRUE).

optional
drag: boolean

TRUE to allow the popup to be dragged with the mouse by grabbing at the border. Has no effect if the popup does not have a border. As soon as dragging starts and "pos" is "center" it is changed to "topleft".

optional
dragall: boolean

TRUE to allow the popup to be dragged from every position. Makes it very difficult to select text in the popup.

optional
resize: boolean

TRUE to allow the popup to be resized with the mouse by grabbing at the bottom right corner. Has no effect if the popup does not have a border.

optional
close: "none" | "click" | "button"

When "button" an X is displayed in the top-right, on top of any border, padding or text. When clicked on the X the popup will close. Any callback is invoked with the value -2. When "click" any mouse click in the popup will close it. When "none" (the default) mouse clicks do not close the popup window.

optional
highlight: string

Highlight group name to use for the text, stored in the 'wincolor' option.

optional
padding: readonly [] | readonly
[
number,
number,
number,
number,
]

List with numbers, defining the padding above/right/below/left of the popup (similar to CSS). An empty list uses a padding of 1 all around. The padding goes around the text, inside any border. Padding uses the 'wincolor' highlight. Example: [1, 2, 1, 3] has 1 line of padding above, 2 columns on the right, 1 line below and 3 columns on the left.

optional
border: readonly [] | readonly
[
number,
number,
number,
number,
]

List with numbers, defining the border thickness above/right/below/left of the popup (similar to CSS). Only values of zero and non-zero are currently recognized. An empty list uses a border all around.

optional
borderhighlight: readonly [string] | readonly
[
string,
string,
string,
string,
]

List of highlight group names to use for the border. When one entry it is used for all borders, otherwise the highlight for the top/right/bottom/left border. Example: ['TopColor', 'RightColor', 'BottomColor, 'LeftColor']

optional
borderchars: readonly
[
string,
string,
string,
string,
]
| readonly
[
string,
string,
string,
string,
string,
string,
string,
string,
]

List with characters, defining the character to use for the top/right/bottom/left border. Optionally followed by the character to use for the topleft/topright/botright/botleft corner. Example: ['-', '|', '-', '|', '┌', '┐', '┘', '└'] When the list has one character it is used for all. When the list has two characters the first is used for the border lines, the second for the corners. By default a double line is used all around when 'encoding' is "utf-8" and 'ambiwidth' is "single", otherwise ASCII characters are used.

optional
scrollbar: 0 | 1 | true

1 or true: show a scrollbar when the text doesn't fit. zero: do not show a scrollbar. Default is non-zero. Also see popup-scrollbar.

optional
scrollbarhighlight: string

Highlight group name for the scrollbar. The background color is what matters. When not given then PmenuSbar is used.

optional
thumbhighlight: string

Highlight group name for the scrollbar thumb. The background color is what matters. When not given then PmenuThumb is used.

optional
zindex: number

Priority for the popup, default 50. Minimum value is 1, maximum value is 32000.

optional
mask: unknown

A list of lists with coordinates, defining parts of the popup that are transparent. See popup-mask.

optional
time: number

Time in milliseconds after which the popup will close. When omitted popup_close() must be used.

optional
moved:
| "any"
| "word"
| "WORD"
| "expr"
| readonly [number, number]
| readonly [number, number, number]

Specifies to close the popup if the cursor moved:

  • "any": if the cursor moved at all
  • "word": if the cursor moved outside <cword>
  • "WORD": if the cursor moved outside <cWORD>
  • "expr": if the cursor moved outside <cexpr>
  • [{start}, {end}]: if the cursor moved before column {start} or after {end}
  • [{lnum}, {start}, {end}]: if the cursor moved away from line {lnum}, before column {start} or after {end}
  • [0, 0, 0] do not close the popup when the cursor moves The popup also closes if the cursor moves to another line or to another window.
optional
mousemoved:
| "any"
| "word"
| "WORD"
| "expr"
| readonly [number, number]
| readonly [number, number, number]

Like "moved" but referring to the mouse pointer position

optional
cursorline: 0 | true

TRUE: Highlight the cursor line. Also scrolls the text to show this line (only works properly when 'wrap' is off). zero: Do not highlight the cursor line. Default is zero, except for popup_menu().

optional
filter: unknown

A callback that can filter typed characters, see popup-filter.

WARNING: Probably this feature doesn't work from Denops because Denops cannot pass Vim script function through JSON RPC.

optional
mapping: boolean

Allow for key mapping. When FALSE and the popup is visible and has a filter callback key mapping is disabled. Default value is TRUE.

optional
filtermode: string

In which modes the filter is used (same flags as with hasmapto() plus "a"): n Normal mode v Visual and Select mode x Visual mode s Select mode o Operator-pending mode i Insert mode l Language-Argument ("r", "f", "t", etc.) c Command-line mode a all modes The default value is "a".

optional
callback: unknown

A callback that is called when the popup closes, e.g. when using popup_filter_menu(), see popup-callback.

WARNING: Probably this feature doesn't work from Denops because Denops cannot pass Vim script function through JSON RPC.