From b15bae5b4de6654fda3bc154807f5029ef5f95c6 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Wed, 21 Jul 2021 11:30:46 +0200 Subject: [PATCH] Update Lua test runner --- nvimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvimrc b/nvimrc index c58b6a9..39dc708 100644 --- a/nvimrc +++ b/nvimrc @@ -215,9 +215,9 @@ _G.run_tests = function() vim.api.nvim_command([[silent up]]) - -- TODO: check that it is not the current window, if the window has a non-term buffer local winid = _G._test_cmd_to_wins[cmd] - if winid == nil or not vim.api.nvim_win_is_valid(winid) or not vim.call("win_gotoid", winid) == -1 then + local current_winid = vim.call("win_getid") + if winid == nil or not vim.api.nvim_win_is_valid(winid) or winid == current_winid or not vim.call("win_gotoid", winid) == -1 then vim.api.nvim_command([[10split]]) winid = vim.call("win_getid") _G._test_cmd_to_wins[cmd] = winid