aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r--src/nvim/api/ui.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index 01f8c9f71c..18befd498f 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -126,7 +126,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
}
}
- if (ui->ui_ext[kUIHlState]) {
+ if (ui->ui_ext[kUIHlState] || ui->ui_ext[kUIMultigrid]) {
ui->ui_ext[kUILinegrid] = true;
}
@@ -245,6 +245,23 @@ static void ui_set_option(UI *ui, bool init, String name, Object value,
name.data);
}
+/// Sets the inner "width" and "height" of the window grid identified by
+/// "grid" handle. If the grid does not exist, set error.
+void nvim_ui_try_resize_grid(uint64_t channel_id, Integer grid, Integer width,
+ Integer height, Error *error)
+ FUNC_API_SINCE(4) FUNC_API_REMOTE_ONLY
+{
+ if (!pmap_has(uint64_t)(connected_uis, channel_id)) {
+ api_set_error(error, kErrorTypeException,
+ "UI not attached to channel: %" PRId64, channel_id);
+ return;
+ }
+
+ // TODO(utkarshme): Check if grid exists
+
+ ui_grid_resize((GridHandle)grid, (int)width, (int)height);
+}
+
/// Pushes data into UI.UIData, to be consumed later by remote_ui_flush().
static void push_call(UI *ui, const char *name, Array args)
{