From e18dbfa4232d0061987b9149483862c8784c458f Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Wed, 15 Oct 2025 20:31:44 +0200 Subject: [PATCH] fix(rust): adjust errorformat --- lua/core/autocommands.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lua/core/autocommands.lua b/lua/core/autocommands.lua index 0f7baa2..30bae29 100644 --- a/lua/core/autocommands.lua +++ b/lua/core/autocommands.lua @@ -56,6 +56,22 @@ vim.api.nvim_create_autocmd("FileType", { end, }) +vim.api.nvim_create_autocmd("FileType", { + pattern = { "rust" }, + callback = function() + vim.bo.errorformat = "%Enote: test %m at %f:%l:%c," + .. "%E%\\%%(%.%#panicked%\\)%\\@=%m at %f:%l:%c:," + .. "%-Gerror: test failed\\, %.%#," + .. "%-Gwarning: %.%# generated 3 warnings%.%#," + .. "%-Gnote: run with `RUST_BACKTRACE=%.%#," + .. "%-G%\\s%#Running%.%#," + .. vim.bo.errorformat:gsub( + "%%E left:%%m,%%C right:%%m %%f:%%l:%%c,", + "" + ) + end, +}) + vim.api.nvim_create_autocmd("FileType", { desc = "Use two space indent for C++ files", pattern = { "cpp" },