@@ -8,7 +8,7 @@ local M = {}
88
99--- ClaudeCodeWindow class for window configuration
1010-- @table ClaudeCodeWindow
11- -- @field height_ratio number Percentage of screen height for the terminal window
11+ -- @field split_ratio number Percentage of screen for the terminal window (height for horizontal, width for vertical splits)
1212-- @field position string Position of the window: "botright", "topleft", "vertical", etc.
1313-- @field enter_insert boolean Whether to enter insert mode when opening Claude Code
1414-- @field hide_numbers boolean Hide line numbers in the terminal window
@@ -49,7 +49,8 @@ local M = {}
4949M .default_config = {
5050 -- Terminal window settings
5151 window = {
52- height_ratio = 0.3 , -- Percentage of screen height for the terminal window
52+ split_ratio = 0.3 , -- Percentage of screen for the terminal window (height or width)
53+ height_ratio = 0.3 , -- DEPRECATED: Use split_ratio instead
5354 position = ' botright' , -- Position of the window: "botright", "topleft", "vertical", etc.
5455 enter_insert = true , -- Whether to enter insert mode when opening Claude Code
5556 hide_numbers = true , -- Hide line numbers in the terminal window
@@ -90,11 +91,11 @@ local function validate_config(config)
9091 end
9192
9293 if
93- type (config .window .height_ratio ) ~= ' number'
94- or config .window .height_ratio <= 0
95- or config .window .height_ratio > 1
94+ type (config .window .split_ratio ) ~= ' number'
95+ or config .window .split_ratio <= 0
96+ or config .window .split_ratio > 1
9697 then
97- return false , ' window.height_ratio must be a number between 0 and 1'
98+ return false , ' window.split_ratio must be a number between 0 and 1'
9899 end
99100
100101 if type (config .window .position ) ~= ' string' then
187188--- @param silent ? boolean Set to true to suppress error notifications (for tests )
188189--- @return ClaudeCodeConfig
189190function M .parse_config (user_config , silent )
191+ -- Handle backward compatibility first
192+ if user_config and user_config .window then
193+ if user_config .window .height_ratio and not user_config .window .split_ratio then
194+ -- Copy height_ratio to split_ratio for backward compatibility
195+ user_config .window .split_ratio = user_config .window .height_ratio
196+ end
197+ end
198+
190199 local config = vim .tbl_deep_extend (' force' , {}, M .default_config , user_config or {})
191200
192201 local valid , err = validate_config (config )
0 commit comments