Closed jfclavette closed 2 weeks ago
Handling of BufReadPre event seems to be the culprit.
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
Have you read the docs and searched existing issues?
Neovim version (nvim -v)
v0.10.0
Operating system/version
Up-to-date Arch Linux
Output of :checkhealth rustaceanvim
How to reproduce the issue
Expected behaviour
No error message is printed.
Actual behaviour
The code action succeeds, but error messages are printed.
E5108: Error executing lua: ...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:90: BufEnter Autocommands for "": Vim(append):Error running markdownlint: ENOENT: no such file or directory
stack traceback:
[C]: in function 'nvim_set_current_win'
...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:90: in function <...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:88>
E5108: Error executing lua: ...cal/share/nvim/lazy/rustaceanvim/lua/rustaceanvim/ui.lua:13: BufEnter Autocommands for "": Vim(append):Error running markdownlint: ENOENT: no such file or directory
stack traceback:
[C]: in function 'nvim_win_close'
...cal/share/nvim/lazy/rustaceanvim/lua/rustaceanvim/ui.lua:13: in function 'close_win'
...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:262: in function <...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:254>
E492: Not an editor command: messagse
The minimal config used to reproduce this issue.