fix(api): nvim_open_tabpage positional "enter"

Problem: nvim_open_tabpage's "enter" argument is optional, which is inconsistent
with nvim_open_win.

Solution: make it a (non-optional) positional argument, like nvim_open_win.

Also change "enter"'s description to be more like nvim_open_win's doc.
This commit is contained in:
Sean Dewar
2026-03-16 13:15:33 +00:00
parent 0c1ed63c05
commit 97b064c9ac
6 changed files with 36 additions and 61 deletions

View File

@@ -1677,12 +1677,12 @@ function vim.api.nvim_notify(msg, log_level, opts) end
---
--- @param buffer integer Buffer to open in the first window of the new tabpage.
--- Use 0 for current buffer.
--- @param enter boolean Enter the tabpage (make it the current tabpage).
--- @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: -1; after current).
--- 0 = first, N = after Nth.
--- @return integer # Tabpage handle of the created tabpage
function vim.api.nvim_open_tabpage(buffer, config) end
function vim.api.nvim_open_tabpage(buffer, enter, config) end
--- Open a terminal instance in a buffer
---

View File

@@ -438,7 +438,6 @@ error('Cannot require a meta file')
--- @field _subpriority? integer
--- @class vim.api.keyset.tabpage_config
--- @field enter? boolean
--- @field after? integer
--- @class vim.api.keyset.user_command