Skip to content

Commit 3c45899

Browse files
committed
nvim: use OpenWindowConfig and fix documentation on OpenWindow
1 parent 06cff0d commit 3c45899

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

nvim/apidef.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -505,30 +505,32 @@ func CreateBuffer(listed, scratch bool) Buffer {
505505
name(nvim_create_buf)
506506
}
507507

508-
// OpenWindow open a new window.
508+
// OpenWindow opens a new window.
509509
//
510510
// Currently this is used to open floating and external windows.
511511
// Floats are windows that are drawn above the split layout, at some anchor
512-
// position in some other window. Floats can be draw internally or by external
512+
// position in some other window. Floats can be drawn internally or by external
513513
// GUI with the |ui-multigrid| extension. External windows are only supported
514514
// with multigrid GUIs, and are displayed as separate top-level windows.
515515
//
516-
// Exactly one of `external` and `relative` must be specified.
516+
// For a general overview of floats, see |api-floatwin|.
517517
//
518-
// With editor positioning row=0, col=0 refers to the top-left corner of the
519-
// screen-grid and row=Lines-1, Columns-1 refers to the bottom-right corner.
520-
// Floating point values are allowed, but the builtin implementation (used by
521-
// TUI and GUIs without multigrid support) will always round down to nearest
522-
// integer.
518+
// Exactly one of External and Relative must be specified. The Width and
519+
// Height of the new window must be specified.
520+
//
521+
// With relative=editor (row=0,col=0) refers to the top-left corner of the
522+
// screen-grid and (row=Lines-1,col=Columns-1) refers to the bottom-right
523+
// corner. Fractional values are allowed, but the builtin implementation
524+
// (used by non-multigrid UIs) will always round down to nearest integer.
523525
//
524526
// Out-of-bounds values, and configurations that make the float not fit inside
525-
// the main editor, are allowed. The builtin implementation will truncate
526-
// values so floats are completely within the main screen grid. External GUIs
527+
// the main editor, are allowed. The builtin implementation truncates values
528+
// so floats are fully within the main screen grid. External GUIs
527529
// could let floats hover outside of the main window like a tooltip, but
528530
// this should not be used to specify arbitrary WM screen positions.
529531
//
530532
// The returns the window handle or 0 when error.
531-
func OpenWindow(buffer Buffer, enter bool, config map[string]interface{}) Window {
533+
func OpenWindow(buffer Buffer, enter bool, config *OpenWindowConfig) Window {
532534
name(nvim_open_win)
533535
}
534536

@@ -613,7 +615,7 @@ func KeyMap(mode string) []*Mapping {
613615
// rhs
614616
// Right-hand-side {rhs} of the mapping.
615617
//
616-
// opts
618+
// opts
617619
// Optional parameters map. Accepts all :map-arguments as keys excluding <buffer> but including noremap.
618620
// Values are Booleans. Unknown key is an error.
619621
func SetKeyMap(mode, lhs, rhs string, opts map[string]bool) {

0 commit comments

Comments
 (0)