mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2025-12-06 06:36:11 +00:00
fix: GH-49 Abort save if buffer is invalid or unloaded (#52)
This commit is contained in:
@@ -73,6 +73,10 @@ local function should_be_saved(buf)
|
||||
end
|
||||
|
||||
local function save(buf)
|
||||
if not api.nvim_buf_is_loaded(buf) then
|
||||
return
|
||||
end
|
||||
|
||||
if not api.nvim_buf_get_option(buf, "modified") then
|
||||
logger.log(buf, "Abort saving buffer")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user