feat: option to quite vim if oil is closed as last buffer (#491)
* feat: auto-quit vim if oil is closed as last buffer * rename auto_close_vim to auto_close_last_buffer * rework actions.close to be more like actions.cd * fix: configure close action correctly * add type annotation, future proofing * fix: typo * fix: typo * refactor: better type annotations and backwards compatibility --------- Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
This commit is contained in:
parent
21705a1deb
commit
81cc9c3f62
2 changed files with 23 additions and 4 deletions
|
|
@ -143,7 +143,16 @@ M.parent = {
|
|||
|
||||
M.close = {
|
||||
desc = "Close oil and restore original buffer",
|
||||
callback = oil.close,
|
||||
callback = function(opts)
|
||||
opts = opts or {}
|
||||
oil.close(opts)
|
||||
end,
|
||||
parameters = {
|
||||
exit_if_last_buf = {
|
||||
type = "boolean",
|
||||
desc = "Exit vim if oil is closed as the last buffer",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
---@param cmd string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue