From dba9e41f5727089950f6e15b094cc3e4ac52d093 Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Thu, 9 Jan 2025 17:11:36 +0100 Subject: [PATCH] Fix so fzf lua (treesitter) doesn't hang the entire terminal window when previewing large minified files --- home/.config/nvim/lua/plugs/fzf.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home/.config/nvim/lua/plugs/fzf.lua b/home/.config/nvim/lua/plugs/fzf.lua index 45f81eb..3aa8088 100644 --- a/home/.config/nvim/lua/plugs/fzf.lua +++ b/home/.config/nvim/lua/plugs/fzf.lua @@ -13,6 +13,13 @@ return { symbol_kinds = { "Variable", "Function", "Method", "Class", "Struct", "Interface" }, }, }, + previewers = { + builtin = { + -- turn off syntax highlighting for files with more than 100KB + -- this avoid hanging when previewing large files (due to treesitter parsing on minified files) + syntax_limit_b = 1024 * 100, -- 100KB + } + } }, config = function() local fzf = require("fzf-lua")