mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 19:28:24 +00:00
fix(bigfile): check that passed path is the one from the buffer
This commit is contained in:
parent
221d979389
commit
8deea64dba
1 changed files with 6 additions and 0 deletions
|
@ -40,7 +40,13 @@ function M.setup()
|
||||||
if not path or not buf or vim.bo[buf].filetype == "bigfile" then
|
if not path or not buf or vim.bo[buf].filetype == "bigfile" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if path ~= vim.api.nvim_buf_get_name(buf) then
|
||||||
|
return
|
||||||
|
end
|
||||||
local size = vim.fn.getfsize(path)
|
local size = vim.fn.getfsize(path)
|
||||||
|
if size <= 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
if size > opts.size then
|
if size > opts.size then
|
||||||
return "bigfile"
|
return "bigfile"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue