From ece8d50bef2bc70c5750fe65c2a30e8adeae81f7 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Thu, 4 Jan 2024 22:47:51 +0000 Subject: [PATCH] Fix treesitter --- vim/.vim/lua/plugins/notify.lua | 3 ++- vim/.vim/lua/plugins/nvim-treesitter.lua | 13 +++++++++++-- vim/.vim/lua/plugins/telescope.lua | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/vim/.vim/lua/plugins/notify.lua b/vim/.vim/lua/plugins/notify.lua index 1a3a566..889ce8d 100644 --- a/vim/.vim/lua/plugins/notify.lua +++ b/vim/.vim/lua/plugins/notify.lua @@ -7,8 +7,9 @@ return { require("notify").setup({ -- background_colour = colors.base, fps = 20, -- default 30 - stages = "slide", -- default fade_in_slide_out + -- stages = "slide", -- default fade_in_slide_out timeout = 5000, -- default 5000 + render = "wrapped-compact", }) vim.notify = require("notify") end, diff --git a/vim/.vim/lua/plugins/nvim-treesitter.lua b/vim/.vim/lua/plugins/nvim-treesitter.lua index 83c9032..9ad6cfd 100644 --- a/vim/.vim/lua/plugins/nvim-treesitter.lua +++ b/vim/.vim/lua/plugins/nvim-treesitter.lua @@ -57,9 +57,18 @@ return { return true end - local max_filesize = 100 * 1024 -- 100 KB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + local max_filesize = 100 * 1024 -- 200 KB + local fname = vim.api.nvim_buf_get_name(buf) + local ok, stats = pcall(vim.loop.fs_stat, fname) if ok and stats and stats.size > max_filesize then + vim.schedule(function() + vim.notify( + string.format( + "Disabling treesitter. File %s exceeds maximum configured size.", + fname + ) + ) + end) return true end end, diff --git a/vim/.vim/lua/plugins/telescope.lua b/vim/.vim/lua/plugins/telescope.lua index 58ab5c6..483baa3 100644 --- a/vim/.vim/lua/plugins/telescope.lua +++ b/vim/.vim/lua/plugins/telescope.lua @@ -35,6 +35,7 @@ local keys = { { "tk", "Telescope Keymaps", desc = "Search Keymaps" }, { "", "lua find_files()", desc = "Find Files in CWD" }, { "tf", "lua find_files()", desc = "Find Files in CWD" }, + { "tn", ":Telescope notify", desc = "Notifications" }, { "tf.", "lua vim.error('use e')", desc = "Find Files in Buffer Directory" }, { "e", "lua search_cwd()", desc = "Find Files in Buffer Directory" }, { "tg", ":Telescope git_files", desc = "Git Files" },