Skip to content

Commit e5a8874

Browse files
committed
fix: Don't hang highlighting when editing a big file
1 parent 1a7b2b9 commit e5a8874

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/debugprint/highlight.lua

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

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

0 commit comments

Comments
 (0)