mirror of
https://github.com/folke/snacks.nvim
synced 2025-07-07 21:25:11 +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
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue