fix(float): disable swapfile for files shown in Float

This commit is contained in:
Folke Lemaitre 2023-10-13 11:37:38 +02:00
parent 33c447b96e
commit 3769461194
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 0 deletions

View File

@ -104,6 +104,8 @@ function M:mount()
self.buf = self.buf self.buf = self.buf
elseif self.opts.file then elseif self.opts.file then
self.buf = vim.fn.bufadd(self.opts.file) self.buf = vim.fn.bufadd(self.opts.file)
vim.bo[self.buf].readonly = true
vim.bo[self.buf].swapfile = false
vim.fn.bufload(self.buf) vim.fn.bufload(self.buf)
vim.bo[self.buf].modifiable = false vim.bo[self.buf].modifiable = false
elseif self.opts.buf then elseif self.opts.buf then