aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/nvim
Commit message (Collapse)AuthorAge
* ci(lua): enable annotation and style checksLewis Russell2026-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - annotation-usage-error and code-style-check are disabled. - vim.inspect relies on a dummy self-assignment for docgen, and its help omits parameter and option details. - LuaLS fallback types obscure iterator inference. - Docgen hardcodes public function names and appends separately sorted files, leaving shared helpers under the inspector heading. Solution: - Enable annotation-usage-error and code-style-check, and fix misplaced annotations. - Document vim.inspect's callable module directly, removing the dummy assignment. Describe its parameters, option defaults and process callback. - Remove LuaLS iterator fallbacks, correct iterator signatures and check values that the improved inference identifies as optional. - Parse callable modules, require bindings and parent module references. Derive public names and inherited function docs from these links, including missing help for vim.async.semaphore() and vim.version(). - Export vim.lsp.tagfunc directly with lazy loading and document its implementation instead of maintaining a wrapper. - Group files in section_order, replacing append_only and merge_files. Merge declarations before sorting each section, placing shared helpers in the main vim section and keeping vim.inspect in alphabetical order. - Add basic parser coverage for callable modules and module links. AI-assisted
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* fix(lua): enable assignment type checking in runtime codeLewis Russell2026-09-25
| | | | | | | | | | | Enable EmmyLua's assign-type-mismatch diagnostic after correcting the runtime annotations and assignments it flags. Correct option, tuple, and return types, and use separate locals when a value changes representation. Add guards and narrow casts where needed so the runtime passes the stricter check. Regenerate the affected docs. AI-assisted
* fix(lua): add missing param annotations (#41911)Lewis Russell2026-09-15
|
* feat(dir): open entries in splits with a, o mappings #41834Barrett Ruth2026-09-11
|
* build: replace LuaLS with EmmyLuaLewis Russell2026-09-07
| | | | | | | | | | | | | | | Problem: LuaLS struggles with the generics used in Nvim's runtime, requiring broad diagnostic suppressions. Indexing is also slow. Solution: Use EmmyLua for type checks in the build and CI. It offers more sophisticated type checking, substantially better support for generics, and much better flow analysis. Correct the affected annotations. Use `@internal`, supported directly by EmmyLua, instead of `@nodoc` for shared internal declarations, and support it in the help parser. AI-assisted
* fix(zip): detect encryption without letting unzip prompt #41422Barrett Ruth2026-08-22
|
* fix(zip): lost password if sent before unzip disables echo #41377Barrett Ruth2026-08-19
|
* fix(zip): missed "password:" prompt if output trails it #41364Justin M. Keyes2026-08-18
| | | | | | | | | | | | | | Problem: Flaky test: RUN T1158 nvim.zip reports an incorrect archive password: 11092.84 ms FAIL The prompt is detected only if the pty output *ends* with "password: ", but a read may return the prompt plus following bytes. Solution: - Match anywhere in the output since the last password was sent. The buffer is cleared before each send, so won't match stale text. - Assert on the reported message, so a failure shows what was reported.
* 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
* feat(dir): set buffer-local CWD #41174Barrett Ruth2026-08-06
|
* feat(fs): vim.fs.normalize{plain:boolean} #41127Olivia Kinnear2026-08-05
| | | | | | `opts.plain=true` does not expand tildes in addition to environment variables, unlike `opts.expand_env=false`. `opts.expand_env=false` is soft-deprecated.
* fix(zip): preserve alternate file #41178Barrett Ruth2026-08-05
|
* fix(dir): preserve alternate file #41177Barrett Ruth2026-08-05
|
* Merge #41112 from erdivartanovich/dir-failed-open-recoveryJustin M. Keyes2026-08-04
|\
| * 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(zip): only refuse a cwd unzip on WindowsBarrett Ruth2026-08-03
| |
* | refactor(zip)!: address entries with zip:// pathsBarrett Ruth2026-08-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `zipfile://{archive}::{entry}` is ambiguous: `::` is legal in both an archive path and an entry path, so the separator cannot be identified. Splitting at the last `::` reads archives correctly but breaks entries that contain it, and the plugin then emits buffer names it cannot read back. Solution: Address entries as `zip://{archive}/{entry}`, joining the two paths. Resolve the split by walking components: the first one that is a regular file is the archive, because a regular file cannot have children on disk. Entry paths may then contain any character, and no escaping is needed. zipPlugin.vim keeps its own scheme, so the Java ftplugin emits whichever form matches the active plugin until the legacy package is removed.
* | fix(zip): do not run unzip from the current directoryBarrett Ruth2026-08-03
| | | | | | | | | | | | | | | | | | | | Problem: Windows searches the current directory before $PATH, so opening an archive in a directory that also contains an `unzip` executable runs that one. The legacy plugin refused this; the port dropped the check. Solution: Refuse to run `unzip` when it resolves to the current directory.
* | fix(zip): do not warn when zip.lua is disabledBarrett Ruth2026-08-03
| |
* | feat(zip): checkhealth and encrypted entriesBarrett Ruth2026-08-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: There is no health check. Encrypted entries cannot be read at all, since Info-ZIP takes a password only from a terminal and `-P` would expose it in the process arguments. Solution: Add `:checkhealth nvim.zip`, reporting the backend and which implementation is handling archives. Prompt for the password on a pty, extracting to a file so the entry's bytes stay off the terminal. Report Info-ZIP's exit code rather than inferring a cause, so an archive using AES is not reported as a failed decryption.
* | docs: func/expr options, misc #41102Justin M. Keyes2026-08-01
| |
* | fix: reviewBarrett Ruth2026-07-29
| |
* | feat(zip): extract archive membersBarrett Ruth2026-07-29
| |
* | fix(zip): list a valid empty archive as emptyBarrett Ruth2026-07-29
| |
* | fix(zip): keep a leading dash from becoming a backend optionBarrett Ruth2026-07-29
|/
* refactor(zip)!: builtin zip.lua plugin #40846Barrett Ruth2026-07-29
| | | | | | | | | | Problem: The bundled `zip` plugin is implemented in Vimscript, making it harder to maintain and build on with Nvim's Lua runtime infrastructure. Solution: Add an opt-out `zip.lua` browser backed by `nvim.dir`, and disable the legacy Vimscript implementation by moving it to `pack/dist/opt/zip/`. Load it with `:packadd zip`.
* fix(dir): "-" on a non-file buffer opens a bogus path #41034Barrett Ruth2026-07-28
|
* 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): 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.
* 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.
* refactor(api): omit optional paramJustin M. Keyes2026-07-13
|
* 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): select origin on parent navigation #40658Barrett Ruth2026-07-09
|
* fix(dir): preserve alternate buffer #40659Barrett Ruth2026-07-09
|
* refactor(dir): use vim.fs.dir()Justin M. Keyes2026-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(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>
* fix(autoread): 'autoread' error if file goes missing #40276Justin M. Keyes2026-06-15
| | | | | | | | | | | | | | | Problem: 'autoread' error if file goes missing. E211: File "runtime/lua/nvim/autoread.lua" no longer available vim.schedule callback: /usr/local/share/nvim/runtime/lua/nvim/autoread.lua:146: Vim:E211: File "test/functional/options/autoread_spec.lua" no longer available stack traceback: [C]: in function 'checktime' /usr/local/share/nvim/runtime/lua/nvim/autoread.lua:146: in function </usr/local/share/nvim/runtime/lua/nvim/autoread.lua:138> Solution: Ignore E211 thrown by `:checktime`.
* fix(autoread): handle autocmd errorsJustin M. Keyes2026-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: Any random ftplugin or other autocmd, can throw an error when `:checktime` reloads a buffer. This causes a trace which makes it look like an issue with `autoread.lua`. vim.schedule callback: …/runtime/lua/nvim/autoread.lua:146: FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20] ..script …/runtime/ftplugin/help.lua: Vim(runtime):E5113: Lua chunk: …/runtime/lua/vim/treesitter.lua:216: Index out of bounds stack traceback: [C]: in function 'nvim_buf_get_text' …/runtime/lua/vim/treesitter.lua:216: in function 'get_node_text' …/runtime/lua/vim/treesitter/query.lua:558: in function 'handler' …/runtime/lua/vim/treesitter/query.lua:843: in function '_match_predicates' …/runtime/lua/vim/treesitter/query.lua:1082: in function '(for generator)' …/runtime/ftplugin/help.lua:91: in function 'runnables' …/runtime/ftplugin/help.lua:124: in main chunk [C]: in function 'checktime' …/runtime/lua/nvim/autoread.lua:146: in function <…/runtime/lua/nvim/autoread.lua:138> Solution: Use pcall() and surface the error via nvim_echo.
* feat(autoread): surface autoread activity via 'busy' flagJustin M. Keyes2026-06-14
| | | | | | | | | | | | | | | | Problem: Old 'autoread' only did `:checktime` on focus-change and shell (":!") commands, and only for non-hidden buffers. Since 'autoread' is now driven by OS filewatcher events, buffers are updated much more eagerly. This should be surfaced to the user somehow, either via a carefully placed notification, or a minimal UI indicator. A "notification" would be noisy, unless it is conditional on specific circumstances (e.g. when "many" buffers are updated). Solution: Use the existing 'busy' buffer-local option as a subtle hint about activity.
* test(autoread): make "debounce" test actually validJustin M. Keyes2026-06-13
|
* feat(autoread): use filewatchers for OS-driven change detection #37971Oleksandr Chekhovskyi2026-06-12
| | | | | | | | | | | | | | | Problem: The 'autoread' option only checks for file changes reactively — on FocusGained, :checktime, CmdlineEnter, etc. — by polling timestamps. External changes are not detected until the user interacts with Neovim. Solution: Add a core module (runtime/lua/nvim/autoread.lua) enabled from runtime/plugin/autoread.lua that watches each buffer's file using vim._watch.watch() (libuv fs_event). On change detection it calls :checktime, which invokes the existing buf_check_timestamp() logic for reload/prompt handling. Watchers are managed via autocmds tied to buffer lifecycle events and respect the 'autoread' option (global and buffer-local).
* refactor: introduce nvim_on internally #39883Justin M. Keyes2026-05-20
| | | | | | | | | Problem: `nvim_create_autocmd` is too verbose and its `callback` requires extra "nesting". Solution: Introduce `nvim_on`. Start using it internally. Then we can get a feel for how it should look before making it public.
* fix(lua): fields of `nvim.spellfile.Opts` are optional #39902Olivia Kinnear2026-05-20
|