mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ext_cmdline: change the content format
This commit is contained in:
parent
550651c130
commit
daec81ab51
@ -450,6 +450,8 @@ states might be represented as separate modes.
|
|||||||
Leave the cmdline.
|
Leave the cmdline.
|
||||||
|
|
||||||
["cmdline_show", content, pos, firstc, prompt]
|
["cmdline_show", content, pos, firstc, prompt]
|
||||||
|
content: List of [highlight group, string]
|
||||||
|
[["Normal", "t"], ["Search", "est"], ...]
|
||||||
When cmdline_external is set to true, nvim will not draw the cmdline
|
When cmdline_external is set to true, nvim will not draw the cmdline
|
||||||
on the grad, instead nvim will send ui events of the cmdline content
|
on the grad, instead nvim will send ui events of the cmdline content
|
||||||
and cursor position to the remote ui. The content is the full content
|
and cursor position to the remote ui. The content is the full content
|
||||||
|
@ -2731,7 +2731,12 @@ void ui_ext_cmdline_char(int c, int shift)
|
|||||||
void ui_ext_cmdline_show(void)
|
void ui_ext_cmdline_show(void)
|
||||||
{
|
{
|
||||||
Array args = ARRAY_DICT_INIT;
|
Array args = ARRAY_DICT_INIT;
|
||||||
ADD(args, STRING_OBJ(cstr_to_string((char *)(ccline.cmdbuff))));
|
Array content = ARRAY_DICT_INIT;
|
||||||
|
Array text = ARRAY_DICT_INIT;
|
||||||
|
ADD(text, STRING_OBJ(cstr_to_string("Normal")));
|
||||||
|
ADD(text, STRING_OBJ(cstr_to_string((char *)(ccline.cmdbuff))));
|
||||||
|
ADD(content, ARRAY_OBJ(text));
|
||||||
|
ADD(args, ARRAY_OBJ(content));
|
||||||
ADD(args, INTEGER_OBJ(ccline.cmdpos));
|
ADD(args, INTEGER_OBJ(ccline.cmdpos));
|
||||||
if (ccline.cmdfirstc != NUL) {
|
if (ccline.cmdfirstc != NUL) {
|
||||||
ADD(args, STRING_OBJ(cstr_to_string((char *)(&ccline.cmdfirstc))));
|
ADD(args, STRING_OBJ(cstr_to_string((char *)(&ccline.cmdfirstc))));
|
||||||
|
@ -54,7 +54,7 @@ describe('External command line completion', function()
|
|||||||
~ |
|
~ |
|
||||||
|
|
|
|
||||||
]], nil, nil, function()
|
]], nil, nil, function()
|
||||||
eq("sign", content)
|
eq({{'Normal', 'sign'}}, content)
|
||||||
eq(4, pos)
|
eq(4, pos)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ describe('External command line completion', function()
|
|||||||
~ |
|
~ |
|
||||||
|
|
|
|
||||||
]], nil, nil, function()
|
]], nil, nil, function()
|
||||||
eq("sign", content)
|
eq({{'Normal', 'sign'}}, content)
|
||||||
eq(true, shown)
|
eq(true, shown)
|
||||||
eq(3, pos)
|
eq(3, pos)
|
||||||
end)
|
end)
|
||||||
@ -79,7 +79,7 @@ describe('External command line completion', function()
|
|||||||
~ |
|
~ |
|
||||||
|
|
|
|
||||||
]], nil, nil, function()
|
]], nil, nil, function()
|
||||||
eq("sin", content)
|
eq({{'Normal', 'sin'}}, content)
|
||||||
eq(true, shown)
|
eq(true, shown)
|
||||||
eq(2, pos)
|
eq(2, pos)
|
||||||
end)
|
end)
|
||||||
@ -105,7 +105,7 @@ describe('External command line completion', function()
|
|||||||
]], nil, nil, function()
|
]], nil, nil, function()
|
||||||
eq(true, shown)
|
eq(true, shown)
|
||||||
eq("input", prompt)
|
eq("input", prompt)
|
||||||
eq("default", content)
|
eq({{'Normal', 'default'}}, content)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
feed('<cr>')
|
feed('<cr>')
|
||||||
@ -117,7 +117,7 @@ describe('External command line completion', function()
|
|||||||
~ |
|
~ |
|
||||||
|
|
|
|
||||||
]], nil, nil, function()
|
]], nil, nil, function()
|
||||||
eq("3", content)
|
eq({{'Normal', '3'}}, content)
|
||||||
eq("\"", char)
|
eq("\"", char)
|
||||||
eq(1, shift)
|
eq(1, shift)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user