mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 08:02:38 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user