Skip to content

Commit b023736

Browse files
committed
refactor: Handle buffer_filetype as local
1 parent a69aba7 commit b023736

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/debugprint/highlight.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ M.setup_highlight = function(print_tag)
2727

2828
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
2929
callback = function(opts)
30+
local buffer_filetype = vim.bo[opts.buf].filetype
31+
3032
-- Automatically ignore 'bigfiles' as detected by snacks' bigfile
3133
-- support:
3234
-- https://github.com/folke/snacks.nvim/blob/main/docs/bigfile.md
33-
if vim.bo[opts.buf].filetype ~= "bigfile" then
35+
if buffer_filetype ~= "bigfile" then
3436
setup_highlight_buffer(print_tag, opts.buf)
3537
end
3638
end,

0 commit comments

Comments
 (0)