Skip to content

Commit

Permalink
fix: disable swapfile for injected formatter temp files (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 16, 2025
1 parent 7001912 commit 6dc21d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/conform/formatters/injected.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ return {
local extension = options.lang_to_ext[lang] or lang
local buf =
vim.fn.bufadd(string.format("%s.%d.%s", vim.api.nvim_buf_get_name(ctx.buf), i, extension))
vim.bo[buf].swapfile = false
-- Actually load the buffer to set the buffer context which is required by some formatters such as `filetype`
vim.fn.bufload(buf)
tmp_bufs[buf] = true
Expand Down

0 comments on commit 6dc21d4

Please sign in to comment.