mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
fix(autocmds): check that buf exists
This commit is contained in:
parent
53f4595b4e
commit
135ce0d7ed
1 changed files with 5 additions and 1 deletions
|
@ -119,7 +119,11 @@ vim.filetype.add({
|
||||||
pattern = {
|
pattern = {
|
||||||
[".*"] = {
|
[".*"] = {
|
||||||
function(path, buf)
|
function(path, buf)
|
||||||
return vim.bo[buf].filetype ~= "bigfile" and path and vim.fn.getfsize(path) > vim.g.bigfile_size and "bigfile"
|
return vim.bo[buf]
|
||||||
|
and vim.bo[buf].filetype ~= "bigfile"
|
||||||
|
and path
|
||||||
|
and vim.fn.getfsize(path) > vim.g.bigfile_size
|
||||||
|
and "bigfile"
|
||||||
or nil
|
or nil
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue