diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-08-05 11:20:05 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2026-08-06 13:17:07 +0200 |
| commit | 1c1dc0558f784a66fb6d0f7dd3bae8d89274ad64 (patch) | |
| tree | 9a04efe19de028e76cb6f354044bd003ac7f3420 /runtime/lua/vim/_stringbuffer.lua | |
| parent | 93696ca9031ddd2a4e119937d69cd6c775369581 (diff) | |
| download | rneovim-1c1dc0558f784a66fb6d0f7dd3bae8d89274ad64.tar.gz rneovim-1c1dc0558f784a66fb6d0f7dd3bae8d89274ad64.tar.bz2 rneovim-1c1dc0558f784a66fb6d0f7dd3bae8d89274ad64.zip | |
feat(cwd): support explicit chdir (:bcd/:tcd/…) in temp context
Problem:
- Explicit `:bcd` (etc.) persists from `nvim_buf_call()` but not from an
autocmd handler targeting a hidden buf (`LspAttach`, `TermRequest`, …),
which needs a `vim.schedule()` workaround.
- `vim._with()` is supposed to work as a "sandbox", discarding
side-effects, but it leaks CWD changes: `:lcd` from a `win` context,
any chdir from a visible-buffer context.
Solution:
- Explicit :cd/:tcd/:bcd during a temp context persists by default.
- "Ambient" directory changes ('autochdir', existing win-local CWD,
etc.) are still undone, as before.
- Add `kCtxKeepDirs`: snapshot/restore the target's full CWD state
(w/b/tp-local, global, cwd). Used by `vim._with()` and `'inccommand'`,
which must not leak state.
Diffstat (limited to 'runtime/lua/vim/_stringbuffer.lua')
0 files changed, 0 insertions, 0 deletions