Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 committed Jan 7, 2025
1 parent 1f49174 commit da00828
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lua/builtin/others.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ vim.api.nvim_create_autocmd("BufReadPre", {
callback = function(event)
if type(event) == "table" and type(event.buf) == "number" then
local bufnr = event.buf
local performance = require("builtin.performance")
local performance = require("builtin.utils.performance")
if performance.file_too_big(bufnr) then
vim.cmd([[
syntax clear
Expand Down
6 changes: 2 additions & 4 deletions lua/configs/RRethy/vim-illuminate/config.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
local constants = require("builtin.constants")

require("illuminate").configure({
providers = {
"regex",
},
-- disable for big file
should_enable = function(bufnr)
local f = vim.api.nvim_buf_get_name(bufnr)
return vim.fn.getfsize(f) <= constants.perf.maxfilesize
local performance = require("builtin.utils.performance")
return not performance.file_too_big(bufnr)
end,
})

Expand Down
2 changes: 1 addition & 1 deletion lua/configs/lukas-reineke/indent-blankline-nvim/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ require("ibl").setup({

local hooks = require("ibl.hooks")
hooks.register(hooks.type.ACTIVE, function(bufnr)
local performance = require("builtin.performance")
local performance = require("builtin.utils.performance")
return not performance.file_too_big(bufnr)
end)
5 changes: 2 additions & 3 deletions lua/configs/nvim-treesitter/nvim-treesitter/config.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local constants = require("builtin.constants")
local message = require("builtin.utils.message")
local uv = vim.uv or vim.loop

Expand All @@ -23,8 +22,8 @@ require("nvim-treesitter.configs").setup({
enable = true,
-- disable for super large file
disable = function(lang, buf)
local ok, stats = pcall(uv.fs_stat, vim.api.nvim_buf_get_name(buf))
return ok and stats and stats.size > constants.perf.maxfilesize
local performance = require("builtin.utils.performance")
return performance.file_too_big(buf)
end,
additional_vim_regex_highlighting = false,
},
Expand Down

0 comments on commit da00828

Please sign in to comment.