From e80d19142bdb7b2856ef304f3a5ae05d22ba6532 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Fri, 19 Sep 2025 10:31:34 -0700 Subject: feat(api): add nvim_open_tabpage Problem: no API function for opening a new tab page and returning its handle, or to open without entering. Solution: add nvim_open_tabpage. --- runtime/lua/vim/_meta/api.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'runtime/lua/vim/_meta/api.lua') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 0510e2bef9..6be9305d48 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -1673,6 +1673,17 @@ function vim.api.nvim_load_context(dict) end --- @return any function vim.api.nvim_notify(msg, log_level, opts) end +--- Opens a new tabpage +--- +--- @param buffer integer Buffer to open in the first window of the new tabpage. +--- Use 0 for current buffer. +--- @param config vim.api.keyset.tabpage_config Configuration for the new tabpage. Keys: +--- - enter: Whether to enter the new tabpage (default: true) +--- - after: Position to insert tabpage (default: 0). +--- 0 = after current, 1 = first, N = before Nth. +--- @return integer # Tabpage handle of the created tabpage +function vim.api.nvim_open_tabpage(buffer, config) end + --- Open a terminal instance in a buffer --- --- By default (and currently the only option) the terminal will not be -- cgit