mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
2.03k stars 210 forks source link

vim.lsp.util.stylize_markdown starts markdownlint #687

Closed rgruyters closed 1 month ago

rgruyters commented 1 month ago

When entering a signature help window, markdownlint gets executed and show warning messages within the window. (check screenshot)

image

When I temporarily remove markdownlint from Mason and try opening a signature window, I get the following error message:

Error executing vim.schedule lua callback: ...unwrapped-0.10.2/share/nvim/runtime/lua/vim/lsp/util.lua:1717: BufEnter Autocommands for "*": Vim(append):Error running markdownlint: ENOENT: no such file or directory                                          
stack traceback:                                                                                                                                                                                                                                               
        [C]: in function 'nvim_set_current_win'                                                                                                                                                                                                                
        ...unwrapped-0.10.2/share/nvim/runtime/lua/vim/lsp/util.lua:1717: in function 'handler'                                                                                                                                                                
        /Users/robin/.config/nvim/lua/kickstart/plugins/lsp.lua:263: in function 'handler'                                                                                                                                                                     
        ...wrapped-0.10.2/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''                                                                                                                                                                        
        vim/_editor.lua: in function <vim/_editor.lua:0>    

Is it possible to disable this feature?

For reference, I use https://github.com/nvim-lua/kickstart.nvim

rgruyters commented 1 month ago

Issue is solved by removing the 'BufEnter' event on autocmd.

vim.api.nvim_create_autocmd({ 'BufWritePost', 'InsertLeave' }, {
    group = vim.api.nvim_create_augroup('nvim-lint', { clear = true }),
    callback = function()
        lint.try_lint()
    end,
})