From 6a454406f5d374a98d06583d5c839c22f4c6803e Mon Sep 17 00:00:00 2001 From: Julien Vincent Date: Thu, 29 Aug 2024 21:33:58 +0200 Subject: [PATCH] Render reports with exceptions and expected better Currently if a report contains an exception then the left-hand-side diff panel is hidden and only the exception is rendered. This change first checks if there is also an `expected` side to the report and if so will continue to render it. --- lua/clojure-test/ui/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/clojure-test/ui/init.lua b/lua/clojure-test/ui/init.lua index 3904498..31f6530 100644 --- a/lua/clojure-test/ui/init.lua +++ b/lua/clojure-test/ui/init.lua @@ -25,6 +25,13 @@ local function handle_on_move(UI, event) if node.assertion then if node.assertion.exceptions then vim.schedule(function() + if node.assertion.expected then + layout:render_double() + write_clojure_to_buf(layout.windows.left.bufnr, node.assertion.expected) + exceptions.render_exceptions_to_buf(layout.windows.right.bufnr, node.assertion.exceptions) + return + end + layout:render_single() exceptions.render_exceptions_to_buf(layout.windows.right.bufnr, node.assertion.exceptions) end)