fix(dir): respect directory buffer lifetime #40453

Problem:
dir.lua leaves previously-navigated directory buffers around.
This is fine by default, but users need a simple way to opt out.

Solution:
1. Respect `set hidden` (via `'bufhidden'`) as one way to make
   previously-navigated dir buffers from showing up.
2. Document a one-liner to hide these buffers
This commit is contained in:
Barrett Ruth
2026-06-27 13:08:28 -05:00
committed by GitHub
parent b138e7a251
commit 9202e2c80c
4 changed files with 47 additions and 2 deletions

View File

@@ -85,7 +85,6 @@ local function render(buf, dir)
not set_buf_options(buf, {
{ 'modeline', false },
{ 'buftype', 'nowrite' },
{ 'bufhidden', 'hide' },
{ 'buflisted', true },
{ 'swapfile', false },
{ 'readonly', false },