feat(#1984): add quit_on_open and focus opts to various api.node.open functions (#3054)

* feat: add quit_on_open opt to api.node.open.edit

* fix: fix missing @param annotation

* feat: add focus opt to api.node.open.edit

* fix: fix focus == false behaviour on api.node.open.tab command

* fix: add optional tabpage integer parameter to view.close

if tabpage is not nil, then the function closes the tabpage in this
specific tabpage

* fix: fix quit_on_open == true behaviour on api.node.open.tab command

* fix: add check to not use new opts for certain edit modes

* fix: add docs for new opts

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Gabriel Crispino
2025-02-21 21:09:49 -03:00
committed by GitHub
parent 80523101f0
commit 3281f331f7
3 changed files with 123 additions and 15 deletions

View File

@@ -270,9 +270,12 @@ function M.close_all_tabs()
end
end
function M.close()
---@param tabpage integer|nil
function M.close(tabpage)
if M.View.tab.sync.close then
M.close_all_tabs()
elseif tabpage then
close(tabpage)
else
M.close_this_tab_only()
end