mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
9afa1fd355
It's a function to perform operations in their own sealed context, similar to pythons `with`. This helps ease operations where you need to perform an operation in a specific context, and then restore the context. Marked as private for now as it's not ready for public use. The current plan is to start using this internally so we can discover and fix any problems. Once this is ready to be exposed it will be renamed to `vim.with`. Usage: ```lua local ret = vim._with({context = val}, function() return "hello" end) ``` , where `context` is any combination of: - `buf` - `emsg_silent` - `hide` - `horizontal` - `keepalt` - `keepjumps` - `keepmarks` - `keeppatterns` - `lockmarks` - `noautocmd` - `options` - `sandbox` - `silent` - `unsilent` - `win` (except for `win` and `buf` which can't be used at the same time). This list will most likely be expanded in the future. Work on https://github.com/neovim/neovim/issues/19832. Co-authored-by: Lewis Russell <lewis6991@gmail.com> |
||
---|---|---|
.. | ||
api | ||
autocmd | ||
core | ||
editor | ||
ex_cmds | ||
fixtures | ||
legacy | ||
lua | ||
options | ||
plugin | ||
provider | ||
script | ||
shada | ||
terminal | ||
treesitter | ||
ui | ||
vimscript | ||
example_spec.lua | ||
preload.lua | ||
testnvim.lua |