Skip to content

Commit 97ef955

Browse files
authored
fix(auto-save-nvim): not restoring buffer settings (#1265)
1 parent 4f1af4b commit 97ef955

File tree

1 file changed

+5
-2
lines changed
  • lua/astrocommunity/editing-support/auto-save-nvim

1 file changed

+5
-2
lines changed

lua/astrocommunity/editing-support/auto-save-nvim/init.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ return {
1515
-- Save global autoformat status
1616
vim.g.OLD_AUTOFORMAT = vim.g.autoformat
1717
vim.g.autoformat = false
18-
vim.g.OLD_AUTOFORMAT_BUFFERS = {}
18+
19+
local old_autoformat_buffers = {}
1920
-- Disable all manually enabled buffers
2021
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
2122
if vim.b[bufnr].autoformat then
22-
table.insert(vim.g.OLD_AUTOFORMAT_BUFFERS, bufnr)
23+
table.insert(old_autoformat_buffers, bufnr)
2324
vim.b[bufnr].autoformat = false
2425
end
2526
end
27+
28+
vim.g.OLD_AUTOFORMAT_BUFFERS = old_autoformat_buffers
2629
end,
2730
},
2831
-- Re-enable autoformat after saving

0 commit comments

Comments
 (0)