fix: GH-49 Abort save if buffer is invalid or unloaded (#52)

This commit is contained in:
Toni Müller
2024-04-08 14:03:27 +02:00
committed by GitHub
parent 42fce87ab4
commit 6971ddca43

View File

@@ -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")