From 28d36da7d985bc80a73c4c10be5b57b260ac0b8f Mon Sep 17 00:00:00 2001 From: disrupted Date: Thu, 29 Jan 2026 19:28:14 +0100 Subject: [PATCH] fix(ui): fix broken toggle_zoom when input is hidden --- lua/opencode/ui/ui.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/opencode/ui/ui.lua b/lua/opencode/ui/ui.lua index 490180f8..6ddc0482 100644 --- a/lua/opencode/ui/ui.lua +++ b/lua/opencode/ui/ui.lua @@ -274,7 +274,7 @@ end function M.toggle_zoom() local windows = state.windows - if not windows or not windows.output_win or not windows.input_win then + if not windows or not (windows.output_win or windows.input_win) then return end @@ -288,8 +288,12 @@ function M.toggle_zoom() width = math.floor(config.ui.zoom_width * vim.o.columns) end - vim.api.nvim_win_set_config(windows.input_win, { width = width }) - vim.api.nvim_win_set_config(windows.output_win, { width = width }) + if windows.input_win ~= nil then + vim.api.nvim_win_set_config(windows.input_win, { width = width }) + end + if windows.output_win ~= nil then + vim.api.nvim_win_set_config(windows.output_win, { width = width }) + end end return M