fix(bigfile): check that passed path is the one from the buffer

This commit is contained in:
Folke Lemaitre 2025-02-06 19:11:53 +01:00
parent 221d979389
commit 8deea64dba
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -40,7 +40,13 @@ function M.setup()
if not path or not buf or vim.bo[buf].filetype == "bigfile" then
return
end
if path ~= vim.api.nvim_buf_get_name(buf) then
return
end
local size = vim.fn.getfsize(path)
if size <= 0 then
return
end
if size > opts.size then
return "bigfile"
end