Skip to content

Commit

Permalink
fix(autocmds): check that buf exists
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 26, 2024
1 parent 53f4595 commit 135ce0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/lazyvim/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ vim.filetype.add({
pattern = {
[".*"] = {
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
end,
},
Expand Down

0 comments on commit 135ce0d

Please sign in to comment.