diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-08-15 11:45:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-15 11:45:44 -0400 |
| commit | cd2db7913af68632efb1642b7dafd5cba24bf75c (patch) | |
| tree | 421051caa7fd732be0377ff441532262e3d86805 /runtime/lua/vim | |
| parent | 9cca923ab4f9ddca4b817e989eba546ddba675e1 (diff) | |
| download | rneovim-cd2db7913af68632efb1642b7dafd5cba24bf75c.tar.gz rneovim-cd2db7913af68632efb1642b7dafd5cba24bf75c.tar.bz2 rneovim-cd2db7913af68632efb1642b7dafd5cba24bf75c.zip | |
fix(cwd): nvim_win_set_buf changes global CWD #41328
Problem:
nvim_win_set_buf() on a non-current win, while the current win has
a win-local dir, changes the global CWD:
:vsplit | lcd ..
:call nvim_win_set_buf(other_win, buf)
:wincmd l
:verbose pwd
[global] /parent " expected: the initial cwd
Analysis:
`globaldir` is where to return when no local dir applies; NULL means the
process CWD is already there. Switching to a window with no local dir
makes update_cwd() chdir back to `globaldir` and clear it. kCtxKeepCwd
restores the process CWD but not that bookkeeping, so the restored
window-local dir is mistaken for the global one.
Solution:
Save/restore `globaldir` with the CWD.
Diffstat (limited to 'runtime/lua/vim')
0 files changed, 0 insertions, 0 deletions