mirror of
https://github.com/neovim/neovim.git
synced 2026-08-24 16:11:52 +00:00
feat(vim._with): keepcwd
This commit is contained in:
@@ -1480,6 +1480,7 @@ end
|
||||
--- @field go? table<string, any>
|
||||
--- @field hide? boolean
|
||||
--- @field keepalt? boolean
|
||||
--- @field keepcwd? boolean
|
||||
--- @field keepjumps? boolean
|
||||
--- @field keepmarks? boolean
|
||||
--- @field keeppatterns? boolean
|
||||
@@ -1537,9 +1538,6 @@ end
|
||||
--- indicated by the spec is restored.
|
||||
---
|
||||
--- Notes:
|
||||
--- - If `buf`/`win` is specified, CWD state (win/buf/tab-local dirs) is restored after execution.
|
||||
--- Any :cd/:tcd/:lcd/:bcd during execution is undone.
|
||||
--- - TODO: allow opt-out? Workaround: use nvim_buf_call()/nvim_win_call().
|
||||
--- - Context `{ buf = buf }` has no guarantees about current window when
|
||||
--- inside context.
|
||||
--- - Context `{ buf = buf, win = win }` is yet not allowed, but this seems
|
||||
@@ -1571,6 +1569,7 @@ function vim._with(context, f)
|
||||
vim.validate('context.go', context.go, 'table', true)
|
||||
vim.validate('context.hide', context.hide, 'boolean', true)
|
||||
vim.validate('context.keepalt', context.keepalt, 'boolean', true)
|
||||
vim.validate('context.keepcwd', context.keepcwd, 'boolean', true)
|
||||
vim.validate('context.keepjumps', context.keepjumps, 'boolean', true)
|
||||
vim.validate('context.keepmarks', context.keepmarks, 'boolean', true)
|
||||
vim.validate('context.keeppatterns', context.keeppatterns, 'boolean', true)
|
||||
|
||||
Reference in New Issue
Block a user