diff options
-rw-r--r-- | runtime/doc/msgpack_rpc.txt | 7 | ||||
-rw-r--r-- | src/nvim/screen.c | 11 | ||||
-rw-r--r-- | test/functional/ui/tabline_spec.lua | 25 | ||||
-rw-r--r-- | third-party/cmake/BuildLuarocks.cmake | 2 |
4 files changed, 23 insertions, 22 deletions
diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index da9b2360e3..261e68cfb1 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -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: diff --git a/src/nvim/screen.c b/src/nvim/screen.c index a6563534aa..de24156579 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -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)); diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index aa7b432c09..2d5faf394b 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -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) diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake index 7312b6f91b..88ddaf44ce 100644 --- a/third-party/cmake/BuildLuarocks.cmake +++ b/third-party/cmake/BuildLuarocks.cmake @@ -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) |