Module Vcaml.Window

include module type of struct include Nvim_internal.Window end
val sexp_of_t : t -> Sexplib0.Sexp.t
include Core.Comparable.S_plain with type t := t
include Base.Comparable.S with type t := t
include Base.Comparisons.S with type t := t
include Base.Comparisons.Infix with type t := t
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (<) : t -> t -> bool
val (<>) : t -> t -> bool
val equal : t -> t -> bool
val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int

ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.

val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool

between t ~low ~high means low <= t <= high

val clamp_exn : t -> min:t -> max:t -> t

clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.

Raises if not (min <= max).

val clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
type comparator_witness = Nvim_internal.Window.comparator_witness
val validate_lbound : min:t Core.Maybe_bound.t -> t Validate.check
val validate_ubound : max:t Core.Maybe_bound.t -> t Validate.check
val validate_bound : min:t Core.Maybe_bound.t -> max:t Core.Maybe_bound.t -> t Validate.check
module Replace_polymorphic_compare = Nvim_internal.Window.Replace_polymorphic_compare
include Core.Hashable.S_plain with type t := t
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t -> t -> int
include Ppx_hash_lib.Hashable.S_any with type t := t
val hash_fold_t : t Ppx_hash_lib.hash_fold
val hashable : t Base.Hashable.t
include Msgpack.Msgpackable with type t := t
val of_msgpack : Msgpack__.Message.t -> t Core.Or_error.t
val to_msgpack : t -> Msgpack__.Message.t
val get_buf : here:lexing_position -> _ Client.t -> Or_current.t -> Nvim_internal.Buffer.t Async.Deferred.Or_error.t

Get the buffer currently in the window.

val set_buf : here:lexing_position -> _ Client.t -> Or_current.t -> buffer:Nvim_internal.Buffer.t -> unit Async.Deferred.Or_error.t

Set the buffer for the window without triggering autocommands that relate to cursor movements, such as WinEnter or BufEnter. Note that there is an outstanding issue where autocommands that should still be triggered are not being triggered. For details, see https://github.com/neovim/neovim/issues/10070.

val close : here:lexing_position -> _ Client.t -> Or_current.t -> when_this_is_the_buffer's_last_window:When_this_is_the_buffer's_last_window.t -> unit Async.Deferred.Or_error.t

Close the given window. If this is not the current window, no WinLeave event will be triggered because closing it does not require changing windows.

val exists : here:lexing_position -> _ Client.t -> t -> bool Async.Deferred.Or_error.t
val get_height : here:lexing_position -> _ Client.t -> Or_current.t -> int Async.Deferred.Or_error.t
val set_height : here:lexing_position -> _ Client.t -> Or_current.t -> height:int -> unit Async.Deferred.Or_error.t
val get_width : here:lexing_position -> _ Client.t -> Or_current.t -> int Async.Deferred.Or_error.t
val set_width : here:lexing_position -> _ Client.t -> Or_current.t -> width:int -> unit Async.Deferred.Or_error.t
val get_cursor : here:lexing_position -> _ Client.t -> Or_current.t -> Position.One_indexed_row.t Async.Deferred.Or_error.t

Get the cursor position for the given window. Every window in Neovim has a cursor position - for inactive windows, this is the position the cursor will assume when the window becomes active.

val set_cursor : here:lexing_position -> _ Client.t -> Or_current.t -> Position.One_indexed_row.t -> unit Async.Deferred.Or_error.t

Set the cursor position for the given window. This will not move the cursor to the window, but the window will still scroll to ensure the cursor position is visible.

val get_var : here:lexing_position -> _ Client.t -> Or_current.t -> string -> type_:'a Nvim_internal.Phantom.t -> 'a Async.Deferred.Or_error.t

Get a window variable (see `:h w:`).

val set_var : here:lexing_position -> _ Client.t -> Or_current.t -> string -> type_:'a Nvim_internal.Phantom.t -> value:'a -> unit Async.Deferred.Or_error.t

Set a window variable (see `:h w:`). Before using this, note that users have the freedom to change the values of these variables. If that would be undesirable, keep your state management inside your plugin.

val delete_var : here:lexing_position -> _ Client.t -> Or_current.t -> string -> unit Async.Deferred.Or_error.t

Delete a window variable (see `:h w:`).

val get_tab : here:lexing_position -> _ Client.t -> Or_current.t -> Nvim_internal.Tabpage.t Async.Deferred.Or_error.t
val get_number : here:lexing_position -> _ Client.t -> Or_current.t -> int Async.Deferred.Or_error.t

The window number is a relative identifier of the window among the other windows in the tabpage. This is different from the window ID (represented by t), which is unique per window and is never reused.

val get_position : here:lexing_position -> _ Client.t -> Or_current.t -> Position.t Async.Deferred.Or_error.t

Get the display position of the window.

module Config : sig ... end

This module represents the configuration of an external or floating window. An external window exists outside Neovim; a floating window is drawn in Neovim on top of normal windows.

val open_floating : here:lexing_position -> _ Client.t -> ?noautocmd:bool -> unit -> buffer:Nvim_internal.Buffer.Or_current.t -> enter:bool -> config:Config.Floating.t -> minimal_style:bool -> t Async.Deferred.Or_error.t

Open a floating window. enter specifies whether the cursor should be placed in the window after opening it. Most use cases will want to set minimal_style = true. Note that if the given buffer is not loaded, opening it in the floating window may not trigger certain autocommands you may expect to trigger on file load, e.g., FileType autocommands. For details, see https://github.com/neovim/neovim/issues/10070#issuecomment-537854497.

val open_external : here:lexing_position -> _ Client.t -> ?noautocmd:bool -> unit -> buffer:Nvim_internal.Buffer.Or_current.t -> enter:bool -> config:Config.External.t -> minimal_style:bool -> t Async.Deferred.Or_error.t

Open an external window (must be supported by the attached UIs).

val get_config : here:lexing_position -> _ Client.t -> Or_current.t -> Config.t option Async.Deferred.Or_error.t

Returns Some config for floating and external windows and returns None for normal windows.

val set_config : here:lexing_position -> _ Client.t -> Or_current.t -> Config.t -> unit Async.Deferred.Or_error.t

This API obscures a limitation inherent in nvim_win_set_config's interface: because absent config keys will not be changed and there is no support for removing keys, if Config.Floating.corner_pos = Relative_to_text_in_window { ... }, the type of corner positioning cannot be changed because it sets the "bufpos" key, which no other positioning schemes override.

module Statusline : sig ... end
module Winbar : sig ... end
module Statuscolumn : sig ... end
module Fast : sig ... end

These API functions are served immediately without waiting in the input queue.

module Option : sig ... end