Skip to content

Error messages being printed when using both rustaceannvim and mfussenegger/nvim-lint #441

Answered by mrcjkb
jfclavette asked this question in Q&A
Discussion options

You must be logged in to vote

Hey 👋

This isn't a rustaceanvim bug.

The issue is that you're running require("lint").try_lint()
on a markdown buffer (the code action group selector) that's not a file on the filesystem; which can often be the case in Neovim (another example is fugitive blob buffers).

The function should probably check if the file exists on the filesystem before trying to run the linter (although some linter configurations may be capable of passing the buffer content).

Or, you could work around it by checking if the file is readonly in your callback.

Example for Linux:

if not vim.bo[0].readonly then
  require("lint").try_lint()
end

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jfclavette
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #440 on July 02, 2024 15:24.