mfussenegger / nvim-lint

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

Ensure parse functions run in the context of the original buffer #654

Closed mfussenegger closed 3 weeks ago

mfussenegger commented 3 weeks ago

Problem:

People tend to use functions like vim.fn.expand("%:p") in PRs which would be broken because the parse function is called asynchronous after the linter process finished and in the meantime the user could've switched buffers.

Solution:

Use nvim_buf_call to ensure the parse function is run in the context of the original buffer.