diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-12-05 22:30:05 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-12-05 22:30:05 +0100 |
commit | bf8383174b6d3e3cfe5ba42e2de878cfc23416a7 (patch) | |
tree | d51b897318f3071ee47717781472751a5965c0e7 /fnl/plugins | |
parent | 1011bbee0232234d811a5dcdbaeb12bd0619a53e (diff) |
Refactor lint augroup
Diffstat (limited to 'fnl/plugins')
-rw-r--r-- | fnl/plugins/editor/nvim-lint.fnl | 16 |
1 files changed, 10 insertions, 6 deletions
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)] |