aboutsummaryrefslogtreecommitdiff
path: root/runtime/pack/dist/opt/nvim.difftool/lua
Commit message (Collapse)AuthorAge
* 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 nil-safety diagnostics in runtime codeLewis Russell2026-09-25
| | | | | | | | | | | | Enable EmmyLua's need-check-nil diagnostic and resolve nullable values through more precise types, explicit invariants, and guards for missing runtime state. Keep analyzer-specific workarounds local and update the affected API documentation. Exclude the bundled re.lua from analysis so its nil-check warnings do not fail CI. AI-assisted
* fix(lua): generate explicit overloads for vim.fnLewis Russell2026-09-25
| | | | | | | | | | | | | | | | The generated vim.fn stubs represent overloads as repeated function declarations. EmmyLua merges their return types, so getline(lnum) is inferred as string|string[] even though it always returns a string. Generate one declaration with @overload annotations from the existing __N entries, while keeping separate Vimdoc signatures. Parenthesize the overload return list so types such as (0|-1)[] remain arrays. Correct getline()'s single-line and range signatures, and add typed getqflist() signatures for its entry-list and property-query forms. This lets callers infer quickfix results without local type overrides. AI-assisted
* fix(lua): add missing param annotations (#41911)Lewis Russell2026-09-15
|
* build: enable more EmmyLua checksLewis Russell2026-09-08
| | | | | | | | | | | | | | | | - call-non-callable - missing-fields - redefined-label - redefined-local - undefined-field - unreachable-code Promote redefined-local and unreachable-code to warnings. Fix DOS line-ending handling for multiline semantic tokens, and support intersection types in the help parser. AI-assisted
* fix(difftool): handle filenames containing spaces #39740Jackson Ludwig2026-05-14
| | | | | | | | | | | Problem: Using the `DiffTool` plugin (e.g. through `nvim -d ...` or `:DiffTool <file1> <file2>` fails if a space is in one of the paths. This occurs because the `diff` wraps the paths with quotes (`'`) if space characters are present, which the line diff regex fails to parse. Solution: Update regex to handle quoted paths by matching the string within the quotes, if it exists.
* fix(difftool): ensure standardized locale for diff output parsing #38853Tomas Slusny2026-04-07
| | | | | | | Always pass LC_ALL=C to diff when parsing its output. Closes #38838 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* fix(runtime)!: move "tohtml" to pack/dist/opt/ #34557Justin M. Keyes2026-03-23
| | | | | | | | | | | Problem: The "tohtml" plugin is loaded by default. Solution: - Move it to `pack/dist/opt/nvim.tohtml/`, it is an "opt-in" plugin now. - Document guidelines. - Also revert the `plugin/` locations of `spellfile.lua` and `net.lua`. That idea was not worth the trouble, it will be too much re-education for too little gain.
* docs: use "ev" convention in event-handlersJustin M. Keyes2026-03-12
| | | | | | | | | Problem: In autocmd examples, using "args" as the event-object name is vague and may be confused with a user-command. Solution: Use "ev" as the conventional event-object name.
* feat(difftool): replace old "nvim -d" automatically #38057Tomas Slusny2026-02-28
| | | | | | | | | | Problem: "nvim -d" doesn't leverage nvim.difftool. Solution: If nvim.difftool was enabled via :packadd, automatically handle "nvim -d" on startup. nvim -c "packadd nvim.difftool" -d dir1/ dir2/
* fix(difftool): don't reset quickfix list when closing quickfix window #38088Nicknamess962026-02-28
| | | | | | | | | | | | | | | | | Closing the quickfix window previously triggered a WinClosed autocmd that deleted all difftool autocmds and pushed an empty quickfix list, making the difftool non-functional. Users who close the quickfix window to gain screen real estate for viewing diffs had no way to continue navigating entries. Remove the qf_win tracking and its associated WinClosed autocmd so that closing the quickfix window no longer tears down the difftool state. Closing either diff window still performs full cleanup as before. The BufWinEnter handler no longer passes with_qf to diff_files, so navigating entries while the quickfix window is closed reuses the existing diff layout without forcing a layout rebuild. Fixes #37388
* fix(difftool): handle "no differences found" #36671Tomas Slusny2025-11-23
| | | | | | | Add an early exit in diff_dirs to notify the user and return when no differences are detected between directories. This prevents Vim:E42: No Errors exception message See https://github.com/neovim/neovim/pull/35448#issuecomment-3568271456
* fix(difftool): silence :only command in setup_layout #36168Tomas Slusny2025-10-13
| | | | | | | Suppresses output from the :only command by passing the { silent = true } modifier to vim.cmd.only(). This prevents unnecessary messages when setting up the diff layout. Closes #36167
* fix(difftool): add check for window number when cleaning up layout #36161Tomas Slusny2025-10-13
| | | | | | | | | | - Move autocmd cleanup logic back to setup_layout as WinClosed autocmds were triggering for every closed window even when buf scoped, and when buf scoped, pattern filter did not work. - Cleanup when quickfix window is closed as well to prevent state where on closing quickfix setup_layout will reset it after with empty content because of WinClosed autocmds triggering. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* fix(difftool): fully resolve symlinks when comparing paths #36147Tomas Slusny2025-10-12
| | | | | | | | | | | | | | | | | | | Fixes issue on mac where it was constantly reloading buffers as paths were not being normalized and resolved correctly (in relation to buffer name). Quickfix entry: /var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue Buffer name: /private/var/folders/pt/2s7dzyw12v36tsslrghfgpkr0000gn/T/git-difftool.m95lj8/right/app.vue /var was synlinked to /private/var and this was not being properly handled. Also added lazy redraw to avoid too many redraws when this happens in future and added test for symlink handling. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* fix(difftool): ensure split layout, use systemlist #36145Tomas Slusny2025-10-12
| | | | | | | | | | - Always open the right window to the right, regardless of 'splitright' setting, ensuring the left window is always leftmost. - Use `vim.fn.systemlist` for diffr output to avoid manual splitting. - Add a test to verify window layout consistency with 'splitright' and 'nosplitright' options. - Escape quotes in git difftool example properly. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* feat(plugins): nvim.difftool can compare directories #35448Tomas Slusny2025-10-11
Problem: Built-in diff mode (nvim -d) does not support directory diffing as required by git difftool -d. This makes it difficult to compare entire directories, detect renames, and navigate changes efficiently. Solution: Add a DiffTool plugin and command that enables side-by-side diffing of files and directories in Neovim. The plugin supports rename detection, highlights changes in the quickfix list, and provides a user command for easy invocation. This allows proper integration with git difftool -d for directory comparison. Example git config: ```ini [diff] tool = nvim_difftool [difftool "nvim_difftool"] cmd = nvim -c "packadd nvim.difftool" -c "DiffTool $LOCAL $REMOTE" ``` Signed-off-by: Tomas Slusny <slusnucky@gmail.com> Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>