From a72066811f475668222128bfb8c1ede0678b97ef Mon Sep 17 00:00:00 2001 From: Alice Easter Kennedy Date: Tue, 7 Apr 2026 16:50:28 -0400 Subject: [PATCH] Set default option for relative positioning in toggle This is a failsafe for an edgecase where nvim_open_win doesn't know where to put the new window and just crashes --- lua/opencode/terminal.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/opencode/terminal.lua b/lua/opencode/terminal.lua index 63f91a87..7eea621a 100644 --- a/lua/opencode/terminal.lua +++ b/lua/opencode/terminal.lua @@ -9,7 +9,9 @@ local bufnr ---@param cmd string ---@param opts? opencode.terminal.Opts function M.toggle(cmd, opts) - opts = opts or {} + opts = opts or { + relative = "editor" + } if winid ~= nil and vim.api.nvim_win_is_valid(winid) then vim.api.nvim_win_hide(winid)