mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
api/ext_tabline: List of Dicts.
This commit is contained in:
parent
c8e1af93de
commit
6944abad2f
@ -440,9 +440,10 @@ states might be represented as separate modes.
|
||||
|
||||
*ui-ext-tabline*
|
||||
["tabline_update", curtab, tabs]
|
||||
Nvim will send this event when drawing tabline. curtab is the tab id
|
||||
of the current tab. tabs is an array of the form:
|
||||
[tabid, { "name": name }]
|
||||
Tabline was updated. UIs should present this data in a custom tabline
|
||||
widget.
|
||||
curtab: Current Tabpage
|
||||
tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...]
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -7038,15 +7038,14 @@ void ui_ext_tabline_update(void)
|
||||
ADD(args, INTEGER_OBJ(curtab->handle));
|
||||
Array tabs = ARRAY_DICT_INIT;
|
||||
FOR_ALL_TABS(tp) {
|
||||
Dictionary tab_info = ARRAY_DICT_INIT;
|
||||
PUT(tab_info, "tab", TABPAGE_OBJ(tp->handle));
|
||||
|
||||
win_T *cwp = (tp == curtab) ? curwin : tp->tp_curwin;
|
||||
get_trans_bufname(cwp->w_buffer);
|
||||
Array tab = ARRAY_DICT_INIT;
|
||||
ADD(tab, INTEGER_OBJ(tp->handle));
|
||||
|
||||
Dictionary tab_info = ARRAY_DICT_INIT;
|
||||
PUT(tab_info, "name", STRING_OBJ(cstr_to_string((char *)NameBuff)));
|
||||
ADD(tab, DICTIONARY_OBJ(tab_info));
|
||||
ADD(tabs, ARRAY_OBJ(tab));
|
||||
|
||||
ADD(tabs, DICTIONARY_OBJ(tab_info));
|
||||
}
|
||||
ADD(args, ARRAY_OBJ(tabs));
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq
|
||||
local clear, command, eq = helpers.clear, helpers.command, helpers.eq
|
||||
|
||||
describe('ui/tabline', function()
|
||||
local screen
|
||||
local tabs, curtab
|
||||
local event_tabs, event_curtab
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
@ -12,7 +12,7 @@ describe('ui/tabline', function()
|
||||
screen:attach({rgb=true, ext_tabline=true})
|
||||
screen:set_on_event_handler(function(name, data)
|
||||
if name == "tabline_update" then
|
||||
curtab, tabs = unpack(data)
|
||||
event_curtab, event_tabs = unpack(data)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
@ -23,11 +23,12 @@ describe('ui/tabline', function()
|
||||
|
||||
describe('externalized', function()
|
||||
it('publishes UI events', function()
|
||||
local expected = {
|
||||
{1, {['name'] = '[No Name]'}},
|
||||
{2, {['name'] = '[No Name]'}},
|
||||
command("tabedit another-tab")
|
||||
|
||||
local expected_tabs = {
|
||||
{tab = { id = 1 }, name = '[No Name]'},
|
||||
{tab = { id = 2 }, name = 'another-tab'},
|
||||
}
|
||||
feed(":tabnew<CR>")
|
||||
screen:expect([[
|
||||
^ |
|
||||
~ |
|
||||
@ -35,11 +36,11 @@ describe('ui/tabline', function()
|
||||
~ |
|
||||
|
|
||||
]], nil, nil, function()
|
||||
eq(2, curtab)
|
||||
eq(expected, tabs)
|
||||
eq(2, event_curtab)
|
||||
eq(expected_tabs, event_tabs)
|
||||
end)
|
||||
|
||||
feed(":tabNext<CR>")
|
||||
command("tabNext")
|
||||
screen:expect([[
|
||||
^ |
|
||||
~ |
|
||||
@ -47,8 +48,8 @@ describe('ui/tabline', function()
|
||||
~ |
|
||||
|
|
||||
]], nil, nil, function()
|
||||
eq(1, curtab)
|
||||
eq(expected, tabs)
|
||||
eq(1, event_curtab)
|
||||
eq(expected_tabs, event_tabs)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
2
third-party/cmake/BuildLuarocks.cmake
vendored
2
third-party/cmake/BuildLuarocks.cmake
vendored
@ -167,7 +167,7 @@ if(USE_BUNDLED_BUSTED)
|
||||
|
||||
add_custom_command(OUTPUT ${HOSTDEPS_LIB_DIR}/luarocks/rocks/nvim-client
|
||||
COMMAND ${LUAROCKS_BINARY}
|
||||
ARGS build https://raw.githubusercontent.com/neovim/lua-client/0.0.1-25/nvim-client-0.0.1-25.rockspec ${LUAROCKS_BUILDARGS}
|
||||
ARGS build https://raw.githubusercontent.com/neovim/lua-client/0.0.1-26/nvim-client-0.0.1-26.rockspec ${LUAROCKS_BUILDARGS}
|
||||
DEPENDS luv)
|
||||
add_custom_target(nvim-client
|
||||
DEPENDS ${HOSTDEPS_LIB_DIR}/luarocks/rocks/nvim-client)
|
||||
|
Loading…
Reference in New Issue
Block a user