summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_meta/api.lua
diff options
context:
space:
mode:
authorWill Hopkins <willothyh@gmail.com>2025-09-19 10:31:34 -0700
committerSean Dewar <6256228+seandewar@users.noreply.github.com>2026-03-16 13:05:46 +0000
commite80d19142bdb7b2856ef304f3a5ae05d22ba6532 (patch)
treecbb119e3fdfe21c32ed98ffd9afef46cfbc0bcdc /runtime/lua/vim/_meta/api.lua
parent46f538c210e2c1d53d71ddba83ec6cfa36f802e1 (diff)
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.
Diffstat (limited to 'runtime/lua/vim/_meta/api.lua')
-rw-r--r--runtime/lua/vim/_meta/api.lua11
1 files changed, 11 insertions, 0 deletions
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