diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-10-02 10:55:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 10:55:47 +0200 |
commit | 171c80e22769868a1174480c2feeb6675d2828c5 (patch) | |
tree | 235a4101886a60fc401420de39fd0072798858ed /src | |
parent | 8ac44984c49b05940864caa379dab21af6bc5eca (diff) | |
parent | bab3b0ad45d0512ad4e5d42a44807bb39492435f (diff) | |
download | rneovim-171c80e22769868a1174480c2feeb6675d2828c5.tar.gz rneovim-171c80e22769868a1174480c2feeb6675d2828c5.tar.bz2 rneovim-171c80e22769868a1174480c2feeb6675d2828c5.zip |
Merge pull request #9064 from bfredl/uidoc
UI: rename ext_newgrid to ext_linegrid and add --embed UI startup recommendations
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/ui.c | 29 | ||||
-rw-r--r-- | src/nvim/api/ui_events.in.h | 2 | ||||
-rw-r--r-- | src/nvim/syntax.c | 2 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 2 | ||||
-rw-r--r-- | src/nvim/ui.h | 4 |
5 files changed, 20 insertions, 19 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index b49de7abf3..01f8c9f71c 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -127,7 +127,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, } if (ui->ui_ext[kUIHlState]) { - ui->ui_ext[kUINewgrid] = true; + ui->ui_ext[kUILinegrid] = true; } UIData *data = xmalloc(sizeof(UIData)); @@ -227,11 +227,11 @@ static void ui_set_option(UI *ui, bool init, String name, Object value, return; } bool boolval = value.data.boolean; - if (!init && i == kUINewgrid && boolval != ui->ui_ext[i]) { + if (!init && i == kUILinegrid && boolval != ui->ui_ext[i]) { // There shouldn't be a reason for an UI to do this ever // so explicitly don't support this. api_set_error(error, kErrorTypeValidation, - "ext_newgrid option cannot be changed"); + "ext_linegrid option cannot be changed"); } ui->ui_ext[i] = boolval; if (!init) { @@ -271,10 +271,10 @@ static void push_call(UI *ui, const char *name, Array args) static void remote_ui_grid_clear(UI *ui, Integer grid) { Array args = ARRAY_DICT_INIT; - if (ui->ui_ext[kUINewgrid]) { + if (ui->ui_ext[kUILinegrid]) { ADD(args, INTEGER_OBJ(grid)); } - const char *name = ui->ui_ext[kUINewgrid] ? "grid_clear" : "clear"; + const char *name = ui->ui_ext[kUILinegrid] ? "grid_clear" : "clear"; push_call(ui, name, args); } @@ -282,12 +282,12 @@ static void remote_ui_grid_resize(UI *ui, Integer grid, Integer width, Integer height) { Array args = ARRAY_DICT_INIT; - if (ui->ui_ext[kUINewgrid]) { + if (ui->ui_ext[kUILinegrid]) { ADD(args, INTEGER_OBJ(grid)); } ADD(args, INTEGER_OBJ(width)); ADD(args, INTEGER_OBJ(height)); - const char *name = ui->ui_ext[kUINewgrid] ? "grid_resize" : "resize"; + const char *name = ui->ui_ext[kUILinegrid] ? "grid_resize" : "resize"; push_call(ui, name, args); } @@ -295,7 +295,7 @@ static void remote_ui_grid_scroll(UI *ui, Integer grid, Integer top, Integer bot, Integer left, Integer right, Integer rows, Integer cols) { - if (ui->ui_ext[kUINewgrid]) { + if (ui->ui_ext[kUILinegrid]) { Array args = ARRAY_DICT_INIT; ADD(args, INTEGER_OBJ(grid)); ADD(args, INTEGER_OBJ(top)); @@ -341,7 +341,7 @@ static void remote_ui_default_colors_set(UI *ui, Integer rgb_fg, push_call(ui, "default_colors_set", args); // Deprecated - if (!ui->ui_ext[kUINewgrid]) { + if (!ui->ui_ext[kUILinegrid]) { args = (Array)ARRAY_DICT_INIT; ADD(args, INTEGER_OBJ(ui->rgb ? rgb_fg : cterm_fg - 1)); push_call(ui, "update_fg", args); @@ -359,7 +359,7 @@ static void remote_ui_default_colors_set(UI *ui, Integer rgb_fg, static void remote_ui_hl_attr_define(UI *ui, Integer id, HlAttrs rgb_attrs, HlAttrs cterm_attrs, Array info) { - if (!ui->ui_ext[kUINewgrid]) { + if (!ui->ui_ext[kUILinegrid]) { return; } Array args = ARRAY_DICT_INIT; @@ -397,7 +397,7 @@ static void remote_ui_highlight_set(UI *ui, int id) static void remote_ui_grid_cursor_goto(UI *ui, Integer grid, Integer row, Integer col) { - if (ui->ui_ext[kUINewgrid]) { + if (ui->ui_ext[kUILinegrid]) { Array args = ARRAY_DICT_INIT; ADD(args, INTEGER_OBJ(grid)); ADD(args, INTEGER_OBJ(row)); @@ -442,7 +442,7 @@ static void remote_ui_raw_line(UI *ui, Integer grid, Integer row, const sattr_T *attrs) { UIData *data = ui->data; - if (ui->ui_ext[kUINewgrid]) { + if (ui->ui_ext[kUILinegrid]) { Array args = ARRAY_DICT_INIT; ADD(args, INTEGER_OBJ(grid)); ADD(args, INTEGER_OBJ(row)); @@ -508,9 +508,10 @@ static void remote_ui_flush(UI *ui) { UIData *data = ui->data; if (data->buffer.size > 0) { - if (!ui->ui_ext[kUINewgrid]) { + if (!ui->ui_ext[kUILinegrid]) { remote_ui_cursor_goto(ui, data->cursor_row, data->cursor_col); } + push_call(ui, "flush", (Array)ARRAY_DICT_INIT); rpc_send_event(data->channel_id, "redraw", data->buffer); data->buffer = (Array)ARRAY_DICT_INIT; } @@ -549,7 +550,7 @@ static Array translate_firstarg(UI *ui, Array args) static void remote_ui_event(UI *ui, char *name, Array args, bool *args_consumed) { - if (!ui->ui_ext[kUINewgrid]) { + if (!ui->ui_ext[kUILinegrid]) { // the representation of highlights in cmdline changed, translate back // never consumes args if (strequal(name, "cmdline_show")) { diff --git a/src/nvim/api/ui_events.in.h b/src/nvim/api/ui_events.in.h index 456ad0c8cc..9ddf788376 100644 --- a/src/nvim/api/ui_events.in.h +++ b/src/nvim/api/ui_events.in.h @@ -63,7 +63,7 @@ void set_scroll_region(Integer top, Integer bot, Integer left, Integer right) void scroll(Integer count) FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; -// Second revison of the grid protocol, used with ext_newgrid ui option +// Second revison of the grid protocol, used with ext_linegrid ui option void default_colors_set(Integer rgb_fg, Integer rgb_bg, Integer rgb_sp, Integer cterm_fg, Integer cterm_bg) FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL; diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 4c054dc8e0..e0e1897b88 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -6884,7 +6884,7 @@ void do_highlight(const char *line, const bool forceit, const bool init) // "fg", which have been changed now. highlight_attr_set_all(); - if (!ui_is_external(kUINewgrid) && starting == 0) { + if (!ui_is_external(kUILinegrid) && starting == 0) { // Older UIs assume that we clear the screen after normal group is // changed ui_refresh(); diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 575932c7da..bc7d2ca42a 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -156,7 +156,7 @@ UI *tui_start(void) ui->raw_line = tui_raw_line; memset(ui->ui_ext, 0, sizeof(ui->ui_ext)); - ui->ui_ext[kUINewgrid] = true; + ui->ui_ext[kUILinegrid] = true; return ui_bridge_attach(ui, tui_main, tui_scheduler); } diff --git a/src/nvim/ui.h b/src/nvim/ui.h index df489f569f..d89ad60ce7 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -15,7 +15,7 @@ typedef enum { kUITabline, kUIWildmenu, #define kUIGlobalCount (kUIWildmenu+1) - kUINewgrid, + kUILinegrid, kUIHlState, kUIExtCount, } UIExtension; @@ -25,7 +25,7 @@ EXTERN const char *ui_ext_names[] INIT(= { "ext_popupmenu", "ext_tabline", "ext_wildmenu", - "ext_newgrid", + "ext_linegrid", "ext_hlstate", }); |