We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f1af4b commit 97ef955Copy full SHA for 97ef955
lua/astrocommunity/editing-support/auto-save-nvim/init.lua
@@ -15,14 +15,17 @@ return {
15
-- Save global autoformat status
16
vim.g.OLD_AUTOFORMAT = vim.g.autoformat
17
vim.g.autoformat = false
18
- vim.g.OLD_AUTOFORMAT_BUFFERS = {}
+
19
+ local old_autoformat_buffers = {}
20
-- Disable all manually enabled buffers
21
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
22
if vim.b[bufnr].autoformat then
- table.insert(vim.g.OLD_AUTOFORMAT_BUFFERS, bufnr)
23
+ table.insert(old_autoformat_buffers, bufnr)
24
vim.b[bufnr].autoformat = false
25
end
26
27
28
+ vim.g.OLD_AUTOFORMAT_BUFFERS = old_autoformat_buffers
29
end,
30
},
31
-- Re-enable autoformat after saving
0 commit comments