Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhuster committed Nov 8, 2024
1 parent a0e3e8f commit f537923
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/autosave.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ function M.check_buffer()
for i = 1, #vim.g.autosave_disable_inside_paths do
local pattern = vim.g.autosave_disable_inside_paths[i]
pattern = vim.fn.expand(pattern)
if path:sub(1, #pattern) == pattern then
if path:sub(1, #pattern) == pattern and bool(vim.b.autosave_enabled) then
print("Disable autosave for this buffer because it is inside " .. pattern)
vim.b.autosave_enabled = false
return false
end
Expand Down

0 comments on commit f537923

Please sign in to comment.