diff options
author | Will Hopkins <willothyh@gmail.com> | 2024-01-28 23:18:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-29 15:18:33 +0800 |
commit | ca9f6f56949d66f0f6467fa64b215f861fe0a3bf (patch) | |
tree | c65f6084044279f65617c6e7345304edc015b767 /runtime | |
parent | 5e5b004da44c7075ed1e20ae9d05ab09c6f2ac58 (diff) | |
download | rneovim-ca9f6f56949d66f0f6467fa64b215f861fe0a3bf.tar.gz rneovim-ca9f6f56949d66f0f6467fa64b215f861fe0a3bf.tar.bz2 rneovim-ca9f6f56949d66f0f6467fa64b215f861fe0a3bf.zip |
feat(api): add nvim_tabpage_set_win (#27222)
Allows setting the current window of a non-current tabpage
without switching tabpages.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 7 | ||||
-rw-r--r-- | runtime/doc/news.txt | 2 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/api.lua | 6 |
3 files changed, 15 insertions, 0 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 90c9d0ccbb..1831b78e9e 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3336,6 +3336,13 @@ nvim_tabpage_set_var({tabpage}, {name}, {value}) • {name} Variable name • {value} Variable value +nvim_tabpage_set_win({tabpage}, {win}) *nvim_tabpage_set_win()* + Sets the current window in a tabpage + + Parameters: ~ + • {tabpage} Tabpage handle, or 0 for current tabpage + • {win} Window handle, must already belong to {tabpage} + ============================================================================== Autocmd Functions *api-autocmd* diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 40717f8ecf..3051b81189 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -304,6 +304,8 @@ The following new APIs and features were added. highlight attribute. The TUI will display URLs using the OSC 8 control sequence, enabling clickable text in supporting terminals. +• Added |nvim_tabpage_set_win()| to set the current window of a tabpage. + ============================================================================== CHANGED FEATURES *news-changed* diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index f9fa364158..bedc218626 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -1952,6 +1952,12 @@ function vim.api.nvim_tabpage_list_wins(tabpage) end --- @param value any Variable value function vim.api.nvim_tabpage_set_var(tabpage, name, value) end +--- Sets the current window in a tabpage +--- +--- @param tabpage integer Tabpage handle, or 0 for current tabpage +--- @param win integer Window handle, must already belong to {tabpage} +function vim.api.nvim_tabpage_set_win(tabpage, win) end + --- Calls a function with window as temporary current window. --- --- @param window integer Window handle, or 0 for current window |