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.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index 7ba5251c60..9e9be588e3 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -113,6 +113,8 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
ui->set_title = remote_ui_set_title;
ui->set_icon = remote_ui_set_icon;
ui->option_set = remote_ui_option_set;
+ ui->win_scroll_over_start = remote_ui_win_scroll_over_start;
+ ui->win_scroll_over_reset = remote_ui_win_scroll_over_reset;
ui->event = remote_ui_event;
ui->inspect = remote_ui_inspect;
@@ -130,6 +132,13 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
ui->ui_ext[kUILinegrid] = true;
}
+ if (ui->ui_ext[kUIMessages]) {
+ // This uses attribute indicies, so ext_linegrid is needed.
+ ui->ui_ext[kUILinegrid] = true;
+ // Cmdline uses the messages area, so it should be externalized too.
+ ui->ui_ext[kUICmdline] = true;
+ }
+
UIData *data = xmalloc(sizeof(UIData));
data->channel_id = channel_id;
data->buffer = (Array)ARRAY_DICT_INIT;
@@ -208,8 +217,9 @@ static void ui_set_option(UI *ui, bool init, String name, Object value,
return;
}
ui->rgb = value.data.boolean;
- // A little drastic, but only legacy uis need to use this option
- if (!init) {
+ // A little drastic, but only takes effect for legacy uis. For linegrid UI
+ // only changes metadata for nvim_list_uis(), no refresh needed.
+ if (!init && !ui->ui_ext[kUILinegrid]) {
ui_refresh();
}
return;
@@ -245,9 +255,8 @@ static void ui_set_option(UI *ui, bool init, String name, Object value,
name.data);
}
-/// Tell nvim to resize a grid. Nvim sends grid_resize event with the
-/// requested grid size is within size limits and with maximum allowed size
-/// otherwise.
+/// 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.
///
@@ -354,6 +363,9 @@ static void remote_ui_default_colors_set(UI *ui, Integer rgb_fg,
Integer rgb_bg, Integer rgb_sp,
Integer cterm_fg, Integer cterm_bg)
{
+ if (!ui->ui_ext[kUITermColors]) {
+ HL_SET_DEFAULT_COLORS(rgb_fg, rgb_bg, rgb_sp);
+ }
Array args = ARRAY_DICT_INIT;
ADD(args, INTEGER_OBJ(rgb_fg));
ADD(args, INTEGER_OBJ(rgb_bg));
@@ -460,7 +472,7 @@ static void remote_ui_put(UI *ui, const char *cell)
static void remote_ui_raw_line(UI *ui, Integer grid, Integer row,
Integer startcol, Integer endcol,
Integer clearcol, Integer clearattr,
- Boolean wrap, const schar_T *chunk,
+ LineFlags flags, const schar_T *chunk,
const sattr_T *attrs)
{
UIData *data = ui->data;