add cmdline mode to modechange of RPC and tests

use set_cursor_shape_bar for cmdline mode

fix test of screen_basic_spec.lua & screen.lua

comment fix
This commit is contained in:
chemzqm
2016-11-26 07:39:33 +08:00
parent ecd7beb6e4
commit 3cf4b14e96
6 changed files with 65 additions and 7 deletions

View File

@@ -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")));

View File

@@ -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);

View File

@@ -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();
}