Skip to content

Commit 06cff0d

Browse files
committed
nvim: add OpenWindowConfig type
1 parent 1636142 commit 06cff0d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

nvim/types.go

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,60 @@ type VirtualTextChunk struct {
235235
Text string `msgpack:",array"`
236236
HLGroup string `msgpack:",array"`
237237
}
238+
239+
// OpenWindowConfig represents a configs of OpenWindow.
240+
//
241+
// Relative is the specifies the type of positioning method used for the floating window.
242+
// The positioning method keys names:
243+
//
244+
// editor: The global editor grid.
245+
// win: Window given by the `win` field, or current window by default.
246+
// cursor: Cursor position in current window.
247+
//
248+
// Win is the Window for relative="win".
249+
//
250+
// Anchor is the decides which corner of the float to place at row and col.
251+
//
252+
// NW: northwest (default)
253+
// NE: northeast
254+
// SW: southwest
255+
// SE: southeast
256+
//
257+
// Width is the window width (in character cells). Minimum of 1.
258+
//
259+
// Height is the window height (in character cells). Minimum of 1.
260+
//
261+
// BufPos places float relative to buffer text only when relative="win". Takes a tuple of zero-indexed [line, column].
262+
// Row and Col if given are applied relative to this position, else they default to Row=1 and Col=0 (thus like a tooltip near the buffer text).
263+
//
264+
// Row is the row position in units of "screen cell height", may be fractional.
265+
//
266+
// Col is the column position in units of "screen cell width", may be fractional.
267+
//
268+
// Focusable whether the enable focus by user actions (wincmds, mouse events).
269+
// Defaults to true. Non-focusable windows can be entered by SetCurrentWindow.
270+
//
271+
// External is the GUI should display the window as an external top-level window.
272+
// Currently accepts no other positioning configuration together with this.
273+
//
274+
// Style is the Configure the appearance of the window.
275+
// Currently only takes one non-empty value:
276+
//
277+
// minimal:
278+
// Nvim will display the window with many UI options disabled.
279+
// This is useful when displaying a temporary float where the text should not be edited.
280+
// Disables 'number', 'relativenumber', 'cursorline', 'cursorcolumn','foldcolumn', 'spell' and 'list' options. 'signcolumn' is changed to `auto`.
281+
// The end-of-buffer region is hidden by setting `eob` flag of 'fillchars' to a space char, and clearing the EndOfBuffer region in 'winhighlight'.
282+
type OpenWindowConfig struct {
283+
Relative string `msgpack:"relative,omitempty"`
284+
Win Window `msgpack:"win,omitempty"`
285+
Anchor string `msgpack:"anchor,omitempty" empty:"NW"`
286+
Width int `msgpack:"width" empty:"1"`
287+
Height int `msgpack:"height" empty:"1"`
288+
BufPos [2]int `msgpack:"bufpos,omitempty"`
289+
Row int `msgpack:"row,omitempty"`
290+
Col int `msgpack:"col,omitempty"`
291+
Focusable bool `msgpack:"focusable,omitempty" empty:"true"`
292+
External bool `msgpack:"external,omitempty"`
293+
Style string `msgpack:"style,omitempty"`
294+
}

0 commit comments

Comments
 (0)