From bf8383174b6d3e3cfe5ba42e2de878cfc23416a7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 5 Dec 2023 22:30:05 +0100 Subject: Refactor lint augroup --- fnl/plugins/editor/nvim-lint.fnl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'fnl') diff --git a/fnl/plugins/editor/nvim-lint.fnl b/fnl/plugins/editor/nvim-lint.fnl index a5c1fca..2ea01fa 100644 --- a/fnl/plugins/editor/nvim-lint.fnl +++ b/fnl/plugins/editor/nvim-lint.fnl @@ -1,12 +1,16 @@ ;; Linting +(lambda callback [] + (let [lint (require :lint)] + (lint.try_lint))) + (fn init [] - (let [lint-augroup (vim.api.nvim_create_augroup :lint {:clear true}) - lint (require :lint)] - (vim.api.nvim_create_autocmd [:BufEnter :BufWritePost :InsertLeave] - {:group lint-augroup - :callback (lambda [] - (lint.try_lint))}))) + (let [lint-augroup (vim.api.nvim_create_augroup :lint {:clear true})] + (vim.api.nvim_create_autocmd [:BufEnter + :BufWritePost + :InsertLeave + :TextChangedI] + {:group lint-augroup : callback}))) (fn config [] (let [lint (require :lint)] -- cgit v1.2.3-70-g09d2