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",
|
"startuptime",
|
||||||
"tsplayground",
|
"tsplayground",
|
||||||
"checkhealth",
|
"checkhealth",
|
||||||
|
"neotest-output",
|
||||||
},
|
},
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
vim.bo[event.buf].buflisted = false
|
vim.bo[event.buf].buflisted = false
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,26 @@
|
||||||
return {
|
return {
|
||||||
{
|
|
||||||
"nvim-neotest/neotest",
|
|
||||||
dependencies = {
|
|
||||||
-- which key integration
|
|
||||||
{
|
{
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
|
optional = true,
|
||||||
opts = {
|
opts = {
|
||||||
defaults = {
|
defaults = {
|
||||||
["<leader>t"] = { name = "+test" },
|
["<leader>t"] = { name = "+test" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
|
"nvim-neotest/neotest",
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
-- get neotest namespace (api call creates or returns namespace)
|
|
||||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
format = function(diagnostic)
|
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+", "")
|
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
|
||||||
return message
|
return message
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}, neotest_ns)
|
}, 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)
|
require("neotest").setup(opts)
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue