summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/pack/dist/opt/nvim.difftool/lua/difftool.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-07fix(difftool): ensure standardized locale for diff output parsing #38853Tomas Slusny1
Always pass LC_ALL=C to diff when parsing its output. Closes #38838 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2026-03-23fix(runtime)!: move "tohtml" to pack/dist/opt/ #34557Justin M. Keyes1
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.
2026-03-12docs: use "ev" convention in event-handlersJustin M. Keyes1
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.
2026-02-28feat(difftool): replace old "nvim -d" automatically #38057Tomas Slusny1
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/
2026-02-28fix(difftool): don't reset quickfix list when closing quickfix window #38088Nicknamess961
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
2025-11-23fix(difftool): handle "no differences found" #36671Tomas Slusny1
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
2025-10-13fix(difftool): silence :only command in setup_layout #36168Tomas Slusny1
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
2025-10-13fix(difftool): add check for window number when cleaning up layout #36161Tomas Slusny1
- 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>
2025-10-12fix(difftool): fully resolve symlinks when comparing paths #36147Tomas Slusny1
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>
2025-10-12fix(difftool): ensure split layout, use systemlist #36145Tomas Slusny1
- 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>
2025-10-11feat(plugins): nvim.difftool can compare directories #35448Tomas Slusny1
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>