Data Structures | Functions
ui.c File Reference
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/ui.h"
#include "nvim/cursor_shape.h"
#include "nvim/highlight.h"
#include "nvim/map.h"
#include "nvim/memory.h"
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/popupmnu.h"
#include "nvim/screen.h"
#include "nvim/ui.h"
#include "nvim/vim.h"
#include "nvim/window.h"

Data Structures

struct  UIData
 

Functions

void remote_ui_wait_for_attach (void)
 Wait until ui has connected on stdio channel. More...
 
void nvim_ui_attach (uint64_t channel_id, Integer width, Integer height, Dictionary options, Error *err) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY
 
void ui_attach (uint64_t channel_id, Integer width, Integer height, Boolean enable_rgb, Error *err) FUNC_API_DEPRECATED_SINCE(1)
 
void nvim_ui_detach (uint64_t channel_id, Error *err) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY
 
void nvim_ui_try_resize (uint64_t channel_id, Integer width, Integer height, Error *err) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY
 
void nvim_ui_set_option (uint64_t channel_id, String name, Object value, Error *error) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY
 
void nvim_ui_try_resize_grid (uint64_t channel_id, Integer grid, Integer width, Integer height, Error *err) FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY
 
void nvim_ui_pum_set_height (uint64_t channel_id, Integer height, Error *err) FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY
 
void nvim_ui_pum_set_bounds (uint64_t channel_id, Float width, Float height, Float row, Float col, Error *err) FUNC_API_SINCE(7) FUNC_API_REMOTE_ONLY
 

Function Documentation

◆ nvim_ui_attach()

void nvim_ui_attach ( uint64_t  channel_id,
Integer  width,
Integer  height,
Dictionary  options,
Error err 
)

Activates UI events on the channel.

Entry point of all UI clients. Allows |--embed| to continue startup. Implies that the client is ready to show the UI. Adds the client to the list of UIs. |nvim_list_uis()|

Note
If multiple UI clients are attached, the global screen dimensions degrade to the smallest client. E.g. if client A requests 80x40 but client B requests 200x100, the global screen has size 80x40.
Parameters
channel_id
widthRequested screen columns
heightRequested screen rows
options|ui-option| map
[out]errError details, if any

◆ nvim_ui_detach()

void nvim_ui_detach ( uint64_t  channel_id,
Error err 
)

Deactivates UI events on the channel.

Removes the client from the list of UIs. |nvim_list_uis()|

Parameters
channel_id
[out]errError details, if any

◆ nvim_ui_pum_set_bounds()

void nvim_ui_pum_set_bounds ( uint64_t  channel_id,
Float  width,
Float  height,
Float  row,
Float  col,
Error err 
)

Tells Nvim the geometry of the popumenu, to align floating windows with an external popup menu.

Note that this method is not to be confused with |nvim_ui_pum_set_height()|, which sets the number of visible items in the popup menu, while this function sets the bounding box of the popup menu, including visual elements such as borders and sliders. Floats need not use the same font size, nor be anchored to exact grid corners, so one can set floating-point numbers to the popup menu geometry.

Parameters
channel_id
widthPopupmenu width.
heightPopupmenu height.
rowPopupmenu row.
colPopupmenu height.
[out]errError details, if any.

◆ nvim_ui_pum_set_height()

void nvim_ui_pum_set_height ( uint64_t  channel_id,
Integer  height,
Error err 
)

Tells Nvim the number of elements displaying in the popumenu, to decide <PageUp> and <PageDown> movement.

Parameters
channel_id
heightPopupmenu height, must be greater than zero.
[out]errError details, if any

◆ nvim_ui_set_option()

void nvim_ui_set_option ( uint64_t  channel_id,
String  name,
Object  value,
Error error 
)

◆ nvim_ui_try_resize()

void nvim_ui_try_resize ( uint64_t  channel_id,
Integer  width,
Integer  height,
Error err 
)

◆ nvim_ui_try_resize_grid()

void nvim_ui_try_resize_grid ( uint64_t  channel_id,
Integer  grid,
Integer  width,
Integer  height,
Error err 
)

Tell Nvim to resize a grid. Triggers a grid_resize event with the requested grid size or the maximum size if it exceeds size limits.

On invalid grid handle, fails with error.

Parameters
channel_id
gridThe handle of the grid to be changed.
widthThe new requested width.
heightThe new requested height.
[out]errError details, if any

◆ remote_ui_wait_for_attach()

void remote_ui_wait_for_attach ( void  )

Wait until ui has connected on stdio channel.

◆ ui_attach()

void ui_attach ( uint64_t  channel_id,
Integer  width,
Integer  height,
Boolean  enable_rgb,
Error err 
)