diff --git a/symlinks/config/nvim/lua/esensar/init/plugins.lua b/symlinks/config/nvim/lua/esensar/init/plugins.lua index 132e9d4..2b68221 100644 --- a/symlinks/config/nvim/lua/esensar/init/plugins.lua +++ b/symlinks/config/nvim/lua/esensar/init/plugins.lua @@ -71,42 +71,40 @@ return require("lazy").setup({ }, }) - local last = nil - -- Map test running commands local opts = { silent = true } vim.keymap.set("n", "tn", function() - last = nil neotest.run.run() end, opts) vim.keymap.set("n", "tdn", function() - last = { strategy = "dap", suite = false } - neotest.run.run(last) + neotest.run.run({ strategy = "dap", suite = false }) end, opts) vim.keymap.set("n", "tf", function() - last = vim.fn.expand("%") - neotest.run.run(last) + neotest.run.run(vim.fn.expand("%")) end, opts) vim.keymap.set("n", "tdf", function() - last = { vim.fn.expand("%"), strategy = "dap", suite = false } - neotest.run.run(last) + neotest.run.run({ vim.fn.expand("%"), strategy = "dap", suite = false }) end, opts) vim.keymap.set("n", "ts", function() - last = { suite = true } - neotest.run.run(last) + neotest.run.run({ suite = true }) end, opts) vim.keymap.set("n", "tds", function() - last = { strategy = "dap", suite = true } - neotest.run.run(last) + neotest.run.run({ strategy = "dap", suite = true }) end, opts) vim.keymap.set("n", "tl", function() - if last then - neotest.run.run(last) - else - neotest.run.run() - end + neotest.run.run_last() end, opts) vim.keymap.set("n", "tp", neotest.output_panel.open, opts) + vim.keymap.set("n", "ton", function() + neotest.output.open({ enter = true }) + end, opts) + vim.keymap.set("n", "tof", function() + neotest.output.open({ enter = true, position_id = vim.fn.expand("%") }) + end, opts) + vim.keymap.set("n", "tol", function() + neotest.output.open({ enter = true, last_run = true }) + end, opts) + vim.keymap.set("n", "tos", neotest.output_panel.open, opts) end, }, "nvim-neotest/nvim-nio",