Notification support
Would you accept a PR that would bring optional notification on each transfer listing success or failure or list of files transferred
Sure, but what do you need this for? If you want to know if the repo is synced or not there already exists a status to retrieve that withrequire("rsync").status() if I remember correctly.
There is also the on_exit callback in the config, where you can get the exit code of each job. But which file was updated would be a lot more problematic to do.
Sometimes I'm not sure if sync worked or not, and I'm left in the confused state. I was thinking that a small notification in style of LSP could help visually to remind that rsync worked
BTW amazing repo, exactly what i was looking for. Sometimes automatic mode is confusing in the sense if its working or not, it is too seamless and I usually double check about success of copy.
I usually have the status as a part of the statusline, that way you always know if it's synced or not. Depending on how often you save files, a notification every time might be a bit much. But it shouldn't be too hard to add a callback at least.
@isentropic I don't know if this is useful or not but I set up rudimentary notifications like this
return {
"OscarCreator/rsync.nvim",
build = "make",
dependencies = "nvim-lua/plenary.nvim",
config = function()
require("rsync").setup({
-- Your other rsync plugin settings here e.g. sync_on_save, project_config_path etc.
on_exit = function(code, command)
if code == 0 then
vim.notify("✓ Rsync succeeded", vim.log.levels.INFO, { title = "Rsync" })
else
vim.notify("✗ Rsync failed (exit: " .. code .. ")", vim.log.levels.ERROR, { title = "Rsync" })
end
end,
})
}