Skip to content

Commit f3bb0b7

Browse files
committed
Destroy active_ui on unmount
1 parent 7d22daa commit f3bb0b7

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ vim.keymap.set("n", "<localleader>ta", api.run_all_tests, { desc = "Run all test
138138
vim.keymap.set("n", "<localleader>tr", api.run_tests, { desc = "Run tests" })
139139
vim.keymap.set("n", "<localleader>tn", api.run_tests_in_ns, { desc = "Run tests in a namespace" })
140140
vim.keymap.set("n", "<localleader>tp", api.rerun_previous, { desc = "Rerun the most recently run tests" })
141+
vim.keymap.set("n", "<localleader>tf", api.rerun_failed, { desc = "Rerun previously failed tests" })
142+
vim.keymap.set("n", "<localleader>to", api.open_last_report, { desc = "Open the last run test report" })
143+
141144
vim.keymap.set("n", "<localleader>tl", api.load_tests, { desc = "Find and load test namespaces in classpath" })
142145
vim.keymap.set("n", "<localleader>!", function() api.analyze_exception("*e") end, { desc = "Inspect the most recent exception" })
143146
```

lua/clojure-test/api/run.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function M.run_tests(tests)
8383
end
8484
if event.type == "unmount" then
8585
state.unmounted = true
86+
active_ui = nil
8687
return
8788
end
8889
end)

lua/clojure-test/ui/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ function M.create(on_event)
108108
return
109109
end
110110

111-
on_event({
112-
type = "unmount",
113-
})
114-
115111
UI.mounted = false
116112
UI.layout:unmount()
117113
UI.layout = nil
118114
UI.tree = nil
119115

116+
on_event({
117+
type = "unmount",
118+
})
119+
120120
vim.api.nvim_set_current_win(UI.last_active_window)
121121
end
122122

0 commit comments

Comments
 (0)