neovim/test/functional
dundargoc 9afa1fd355 feat(lua): add vim._with
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>
2024-06-08 21:38:06 +02:00
..
api refactor(tests): use more global highlight definitions 2024-05-26 09:22:20 +02:00
autocmd feat(complete): specify reason for CompleteDone 2024-05-24 11:57:46 +02:00
core refactor(tests): more global highlight definitions 2024-05-26 10:24:27 +02:00
editor refactor(tests): more global highlight definitions 2024-05-26 10:24:27 +02:00
ex_cmds test: improve test conventions 2024-04-23 18:17:04 +02:00
fixtures fix(lsp): revert buf_versions deprecation/replacement (#29217) 2024-06-07 11:36:46 +02:00
legacy vim-patch:9.1.0414: Unable to leave long line with 'smoothscroll' and 'scrolloff' 2024-05-17 20:28:14 +02:00
lua feat(lua): add vim._with 2024-06-08 21:38:06 +02:00
options test: improve test conventions 2024-04-23 18:17:04 +02:00
plugin fix(man): filter OSC 8 hyperlink markup #29171 2024-06-07 12:43:17 -07:00
provider test: improve test conventions 2024-04-23 18:17:04 +02:00
script fix(luacats): allow all types inside tuples 2024-06-01 12:56:43 +01:00
shada refactor(shada): remove ShaDaReadDef secondary wrapper 2024-05-28 13:36:54 +02:00
terminal fix(tui): move $COLORTERM check to _defaults.lua (#29197) 2024-06-05 08:27:56 -05:00
treesitter fix(treesitter): find buffer in multiple windows #28922 2024-05-27 04:20:03 -07:00
ui feat: get/set namespace properties #28728 2024-06-07 08:33:40 -07:00
vimscript feat(api): broadcast events to ALL channels #28487 2024-05-17 07:37:39 -07:00
example_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
preload.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
testnvim.lua refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00