Skip to content

Commit

Permalink
Nvim: TSBufDisable requires filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-matsui committed Dec 12, 2024
1 parent c5384e2 commit 78456ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .config/nvim/lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ local function disable_plugins_for_large_files()
local filesize = vim.fn.getfsize(filepath)
if filesize > max_filesize then
-- Disable treesitter
vim.cmd("TSBufDisable")
local filetype = vim.bo.filetype
if filetype ~= "" then
vim.cmd("TSBufDisable " .. filetype)
end
end
end

Expand Down

0 comments on commit 78456ce

Please sign in to comment.