mirror of
https://github.com/neovim/neovim.git
synced 2026-08-14 11:29:31 +00:00
Problem: Re-editing a buffer (`:edit!`, re-reading a dir.lua buffer, etc.) drops its `:bcd` directory, so the CWD falls back to the global one. Whereas other buffer-local state (`b:` vars, local options) survives a reload. Solution: Don't clear buf dir in `buf_freeall()`; `do_ecmd()` calls that when reloading/re-editing. `free_buffer_stuff()` still clears them when a buffer is freed or reused for another file.