mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
refactor(tests): pr changes
This commit is contained in:
parent
1e566b49b5
commit
b5318d6635
2 changed files with 10 additions and 22 deletions
|
|
@ -52,6 +52,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
"startuptime",
|
||||
"tsplayground",
|
||||
"checkhealth",
|
||||
"neotest-output",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
|
|
|
|||
|
|
@ -1,39 +1,26 @@
|
|||
return {
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
-- which key integration
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>t"] = { name = "+test" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
config = function(_, opts)
|
||||
-- get neotest namespace (api call creates or returns namespace)
|
||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
format = function(diagnostic)
|
||||
-- Replace newline and tab characters with space for more compact diagnostics
|
||||
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
|
||||
return message
|
||||
end,
|
||||
},
|
||||
}, neotest_ns)
|
||||
local group = vim.api.nvim_create_augroup("lazyvim_neotest_close_with_q", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = group,
|
||||
pattern = {
|
||||
"neotest-output",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
||||
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue