aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/dir_spec.lua
Commit message (Collapse)AuthorAge
* feat(dir): open entries in splits with a, o mappings #41834Barrett Ruth2026-09-11
|
* test(dir_spec): fix failures with PUC LuaBarrett Ruth2026-08-15
|
* feat(dir): user can sort/filter listings, DirReadPost event #41138Barrett Ruth2026-08-14
| | | | | | | | | | | | Problem: Directory listing entries cannot be customized (filtered, reordered). Listings are read by a BufReadCmd, which suppresses BufReadPost, so they are the only buffers with no post-read event to hook. Solution: Introduce a post-render User autocmd `DirReadPost`, marking the dir buffer writable for the duration and before the cursor is placed, so handlers can sort or filter it with ordinary commands. Document common recipes
* refactor(defaults): edit global cwd on "1-" #41254Nathan Zeng2026-08-11
| | | | | | | | | Problem: `1-` does nothing from a directory buffer, because we are already in the buffer-local CWD. It's also unintuitive that this mapping behaves differently based on the resolved CWD. Solution: Have `1-` open the global CWD.
* feat(dir): set buffer-local CWD #41174Barrett Ruth2026-08-06
|
* fix(dir): preserve alternate file #41177Barrett Ruth2026-08-05
|
* fix(dir): do not swallow errors raised after the list callbackerdivartanovich2026-08-04
| | | | | | | | Problem: An error raised after the list handler ran (e.g. while rendering) unwinds through the pcall around provider.list() and is routed back into the now no-op handler: silently discarded. Solution: Re-raise the error when the handler has already run.
* fix(dir): keep a listing buffer when the initial listing failserdivartanovich2026-08-04
| | | | | | | | | | | | Problem: A failed initial directory listing discards the listing state: the user is left in an empty modifiable non-listing buffer, and the BufEnter autocmd retries the failing open, repeating the error on every re-entry. Solution: Render the failure as an empty listing with state and handlers intact: the error is reported once and "R" or :edit retries the listing. Keep the error on the listing state so a failed listing is distinguishable from an empty one; the next list clears it.
* fix(dir): "-" on a non-file buffer opens a bogus path #41034Barrett Ruth2026-07-28
|
* feat(dir): open cwd with `1-` #40948Barrett Ruth2026-07-27
|
* test: start plugin specs with `--clean` #40995Barrett Ruth2026-07-27
|
* Merge #40910 from barrettruth/fix/dir-literal-env-pathsJustin M. Keyes2026-07-26
|\
| * fix(dir): preserve environment variables in pathsBarrett Ruth2026-07-25
| |
* | fix(dir): `:browse edit` opens dir browser #40930Barrett Ruth2026-07-25
| | | | | | | | | | | | | | | | Problem: `:browse edit` (and variants) without an argument fails instead of opening a browser. Solution: Dispatch to dir.lua using the cwd as the implied directory. Replace the inherited GUI-only documentation with the supported behavior. Support vsplit, split, tabedit variants.
* | feat(dir): support counts for parent navigation #40927Barrett Ruth2026-07-24
| |
* | fix(dir): open CWD from unnamed buffer with `-` mapping #40926Barrett Ruth2026-07-24
|/
* feat(dir): provider framework #40738Barrett Ruth2026-07-22
| | | | | | | | | Problem: The core behaviors of `nvim.dir` cannot be reused by consumers such as the archive plugin, ssh browser, etc. Solution: - Define a basic "provider" shape. - Extract the filesystem provider.
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* fix(dir): custom 3P directory-browser #40725Barrett Ruth2026-07-16
| | | | | | | | | | Problem: Third-party directory browsers do not have a documented way to take over local directory buffers from nvim.dir. Solution: Document deleting the nvim.dir augroup and handling FileType directory as the after-startup handoff, and avoid installing the built-in buffer-local "-" mapping when "-" is already mapped.
* fix(dir): let 3P dir-browser plugin rename the dir buffer #40529Barrett Ruth2026-07-13
| | | | | | | | | | | | | | | | | | | Problem: `FileType directory` fires *before* the `BufEnter` path where `dir.lua` populates the buffer, in order to allow a 3P dir-browser plugin to handle the event and (optionally) rename the buffer to e.g. `example:///tmp/foo/`. But currently, `open_buffer()` continues after `filetypedetect BufRead` as if the original directory buffer is *still* current and valid, which may fall through to the built-in `nvim.dir` path after a 3P plugin ALREADY handled the directory. Solution: Keep a buf ref around the early `filetypedetect BufRead` call for directory buffers. If the `FileType directory` handler switches away from/deletes the original directory buffer, stop the open path instead of continuing into the built-in `nvim.dir` flow.
* fix(filetype): trigger FileType after BufReadCmd #40679Barrett Ruth2026-07-13
| | | | | | | | | | | | | Problem: A successful `BufReadCmd` can leave an existing `filetype` without rerunning its `FileType` setup, so state cleared during reload may not be restored. This also causes `:edit`/reload syntax `directoryDirectory` groups to not be reapplied. Solution: After `BufReadCmd` handles a read, trigger `FileType` for the existing `filetype` if no `FileType` event fired during the read.
* test(dir): "replace `-` mapping" hangs the Windows CIJustin M. Keyes2026-07-11
|
* fix(filetype): ensure directory bufname ends w/ slash sep #40552Barrett Ruth2026-07-10
| | | | | | | | | | | | Problem: `vim.filetype.match()` needs a cheap way to recognize directory buffers without doing filesystem stat work. Solution: Ensure full buffer names for directories end in a trailing slash. Now directory buffers can proceed through the normal 'filetype' path. Note side-effects: session and ShaDa buffer-list restore behavior must be compatible, so those + corresponding tests must be updated.
* fix(dir): user/plugin can override default "-" mapping #40676Barrett Ruth2026-07-10
|
* fix(dir): select origin on parent navigation #40658Barrett Ruth2026-07-09
|
* fix(dir): preserve alternate buffer #40659Barrett Ruth2026-07-09
|
* refactor(test): unify XDG path handling (cmake vs zig)bfredl2026-07-06
| | | | fixes #40381
* fix(dir): define "-" (up/parent) mapping earlier #40531Barrett Ruth2026-07-02
| | | | | | | | | | Problem: The dir.lua "-" mapping cannot be easily overridden (because of autocmd ordering). Solution: - Move it to defaults.lua. - Also to be extra polite: fall back to builtin `-` motion if the user disabled the `dir.lua` plugin.
* fix(dir): restore loaded plugin guard #40528Barrett Ruth2026-07-01
|
* fix(dir): reload listing on :edit #40496Barrett Ruth2026-06-30
|
* fix(dir): remove loaded plugin guard #40489Barrett Ruth2026-06-30
|
* fix(dir): respect directory buffer lifetime #40453Barrett Ruth2026-06-27
| | | | | | | | | | 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
* feat(dir.lua): global "-" default mapping #40426Barrett Ruth2026-06-26
|
* test(runtime): exercise dir.lua on Windows #40423Barrett Ruth2026-06-25
|
* feat(runtime): replace netrw with a very small script #39723Barrett Ruth2026-06-25
Problem: `:edit <dir>` and `nvim <dir>` currently rely on netrw to show local directory contents. Solution: - Provide `filetype=directory`. - Introduce dir.lua, a small plugin that provides directory listing, opening items, parent navigation, and refresh. - `netrw` remains available for `:Explore`, remote paths, archives, and file operations. To continue Co-authored-by: Justin M. Keyes <justinkz@gmail.com>