Skip to content

Commit a201bab

Browse files
committed
feat(ui): track last window width ratio on hide
Store the ratio of the output window's width to the total columns when hiding windows, unless the UI position is 'current'. This enables restoring window sizes more accurately.
1 parent c7ae945 commit a201bab

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lua/opencode/ui/ui.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ function M.hide_visible_windows(windows)
134134

135135
local snapshot = capture_hidden_snapshot(windows)
136136

137+
if config.ui.position ~= 'current' then
138+
local total_cols = vim.o.columns
139+
local current_width = vim.api.nvim_win_get_width(windows.output_win)
140+
state.last_window_width_ratio = current_width / total_cols
141+
end
142+
137143
state.clear_hidden_window_state()
138144

139145
prepare_window_close()

0 commit comments

Comments
 (0)