perf: added support for LazyFile event that properly loads file based plugins without blocking the ui

This commit is contained in:
Folke Lemaitre 2023-10-04 10:45:10 +02:00
parent f15dd301e5
commit 936d74bb61
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
8 changed files with 58 additions and 14 deletions

View file

@ -1,7 +1,7 @@
return {
{
"mfussenegger/nvim-lint",
event = "BufReadPost",
event = "LazyFile",
opts = {
-- Event to trigger linters
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
@ -43,7 +43,6 @@ return {
end
function M.lint()
local lint = require("lint")
local names = lint.linters_by_ft[vim.bo.filetype] or {}
local ctx = { filename = vim.api.nvim_buf_get_name(0) }
ctx.dirname = vim.fn.fnamemodify(ctx.filename, ":h")