API/nvim_list_uis(): include "chan" field for TUI

Even though it's always zero currently, it's less confusing if all UIs
have the same fields.
This commit is contained in:
Justin M. Keyes
2019-09-11 22:29:28 -07:00
parent 6dd56d0902
commit 44d45e29ea
3 changed files with 9 additions and 5 deletions

View File

@@ -484,9 +484,7 @@ Array ui_array(void)
PUT(info, ui_ext_names[j], BOOLEAN_OBJ(ui->ui_ext[j])); PUT(info, ui_ext_names[j], BOOLEAN_OBJ(ui->ui_ext[j]));
} }
} }
if (ui->inspect) { ui->inspect(ui, &info);
ui->inspect(ui, &info);
}
ADD(all_uis, DICTIONARY_OBJ(info)); ADD(all_uis, DICTIONARY_OBJ(info));
} }
return all_uis; return all_uis;

View File

@@ -63,6 +63,7 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler)
rv->bridge.set_icon = ui_bridge_set_icon; rv->bridge.set_icon = ui_bridge_set_icon;
rv->bridge.option_set = ui_bridge_option_set; rv->bridge.option_set = ui_bridge_option_set;
rv->bridge.raw_line = ui_bridge_raw_line; rv->bridge.raw_line = ui_bridge_raw_line;
rv->bridge.inspect = ui_bridge_inspect;
rv->scheduler = scheduler; rv->scheduler = scheduler;
for (UIExtension i = 0; (int)i < kUIExtCount; i++) { for (UIExtension i = 0; (int)i < kUIExtCount; i++) {
@@ -215,3 +216,8 @@ static void ui_bridge_option_set_event(void **argv)
api_free_object(value); api_free_object(value);
xfree(argv[3]); xfree(argv[3]);
} }
static void ui_bridge_inspect(UI *ui, Dictionary *info)
{
PUT(*info, "chan", INTEGER_OBJ(0));
}

View File

@@ -721,8 +721,8 @@ describe('TUI', function()
| |
{4:~ }| {4:~ }|
{5: }| {5: }|
[[['height', 6], ['override', v:false], ['rgb', v:| [[['chan', 0], ['height', 6], ['override', v:false|
false], ['width', 50]]] | ], ['rgb', v:false], ['width', 50]]] |
{10:Press ENTER or type command to continue}{1: } | {10:Press ENTER or type command to continue}{1: } |
{3:-- TERMINAL --} | {3:-- TERMINAL --} |
]=]) ]=])