mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2026-06-08 04:31:06 +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
|
end
|
||||||
|
|
||||||
local function save(buf)
|
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
|
if not api.nvim_buf_get_option(buf, "modified") then
|
||||||
logger.log(buf, "Abort saving buffer")
|
logger.log(buf, "Abort saving buffer")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user