diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2016-12-01 08:05:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 08:05:44 +0100 |
commit | 1f8a3da796dd3418c5204c76192179dbdd6a5373 (patch) | |
tree | 74c5d925a279cd3e59a8adace6e0cbb32c40dca0 /src | |
parent | 0e1c406df4e661602b67dde5e46d69fe7345b1a9 (diff) | |
parent | 3cf4b14e966ec04371d38af6451bc69eaadb425b (diff) | |
download | rneovim-1f8a3da796dd3418c5204c76192179dbdd6a5373.tar.gz rneovim-1f8a3da796dd3418c5204c76192179dbdd6a5373.tar.bz2 rneovim-1f8a3da796dd3418c5204c76192179dbdd6a5373.zip |
Merge pull request #5669 from chemzqm/add-cmdline-mode-rpc
Add cmdline mode to ui_mode_change
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/ui.c | 2 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 4 | ||||
-rw-r--r-- | src/nvim/ui.c | 11 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 56b41f1eea..9178538110 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -271,6 +271,8 @@ static void remote_ui_mode_change(UI *ui, int mode) ADD(args, STRING_OBJ(cstr_to_string("insert"))); } else if (mode == REPLACE) { ADD(args, STRING_OBJ(cstr_to_string("replace"))); + } else if (mode == CMDLINE) { + ADD(args, STRING_OBJ(cstr_to_string("cmdline"))); } else { assert(mode == NORMAL); ADD(args, STRING_OBJ(cstr_to_string("normal"))); diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 5e30517c5a..2171e580ba 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -461,6 +461,10 @@ static void tui_mode_change(UI *ui, int mode) if (data->showing_mode != INSERT) { unibi_out(ui, data->unibi_ext.set_cursor_shape_bar); } + } else if (mode == CMDLINE) { + if (data->showing_mode != CMDLINE) { + unibi_out(ui, data->unibi_ext.set_cursor_shape_bar); + } } else if (mode == REPLACE) { if (data->showing_mode != REPLACE) { unibi_out(ui, data->unibi_ext.set_cursor_shape_ul); diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 549ed8aa7d..ea0bccb1cd 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -532,13 +532,16 @@ static void ui_mode_change(void) if (!full_screen) { return; } - /* Get a simple UI mode out of State. */ - if ((State & REPLACE) == REPLACE) + // Get a simple UI mode out of State. + if ((State & REPLACE) == REPLACE) { mode = REPLACE; - else if (State & INSERT) + } else if (State & INSERT) { mode = INSERT; - else + } else if (State & CMDLINE) { + mode = CMDLINE; + } else { mode = NORMAL; + } UI_CALL(mode_change, mode); conceal_check_cursur_line(); } |