fix(difftool): handle "no differences found" #36671

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
This commit is contained in:
Tomas Slusny
2025-11-23 22:01:57 +01:00
committed by GitHub
parent 10c11c4644
commit a88c7962a8

View File

@@ -369,6 +369,12 @@ local function diff_dirs(left_dir, right_dir, opt)
return
end
-- Early exit if no differences found
if #qf_entries == 0 then
vim.notify('No differences found', vim.log.levels.INFO)
return
end
-- Sort entries by filename for consistency
table.sort(qf_entries, function(a, b)
return a.user_data.rel < b.user_data.rel