aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorJohn Gehrig <jgehrig@users.noreply.github.com>2021-06-27 15:30:09 -0400
committerGitHub <noreply@github.com>2021-06-27 15:30:09 -0400
commit5aaa1a1c0473d9e9ac824201f92ec65e190beeb7 (patch)
treec444f01a33a27801f73d4afebd19dc65ee36d068 /src/nvim/screen.c
parentbdf3df4027a5389a46b4c9a75b50aff5c0ecb351 (diff)
downloadrneovim-5aaa1a1c0473d9e9ac824201f92ec65e190beeb7.tar.gz
rneovim-5aaa1a1c0473d9e9ac824201f92ec65e190beeb7.tar.bz2
rneovim-5aaa1a1c0473d9e9ac824201f92ec65e190beeb7.zip
[RDY] Add buffer information to tabline_update (#12481)
* Add buffer information to tabline_update Most terminal implementations of the tabline display buffer and tab information. Many neovim-qt users disable GuiTabline because it lacks functionality provided in the terminal implementation. The tabline_update event should include buffer information too, so client GUIs can display rich useful tabs.
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 04157a0154..3446a944cd 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -7211,7 +7211,24 @@ void ui_ext_tabline_update(void)
ADD(tabs, DICTIONARY_OBJ(tab_info));
}
- ui_call_tabline_update(curtab->handle, tabs);
+
+ Array buffers = ARRAY_DICT_INIT;
+ FOR_ALL_BUFFERS(buf) {
+ // Do not include unlisted buffers
+ if (!buf->b_p_bl) {
+ continue;
+ }
+
+ Dictionary buffer_info = ARRAY_DICT_INIT;
+ PUT(buffer_info, "buffer", BUFFER_OBJ(buf->handle));
+
+ get_trans_bufname(buf);
+ PUT(buffer_info, "name", STRING_OBJ(cstr_to_string((char *)NameBuff)));
+
+ ADD(buffers, DICTIONARY_OBJ(buffer_info));
+ }
+
+ ui_call_tabline_update(curtab->handle, tabs, curbuf->handle, buffers);
}
/*