@@ -15,6 +15,7 @@ local config = {
1515 width = 0.6 ,
1616 height = 0.4 ,
1717 border = " rounded" ,
18+ width_ratio = 0.4 ,
1819 },
1920 },
2021 scroll = {
7778--- @field height ? number # Height of the window (0–1 for percentage)
7879--- @field border ? string # Border style (e.g., "single", "rounded")
7980
81+ --- @class ListWindowConfig : WindowConfig
82+ --- @field width_ratio ? number # Ratio (0–1) of list vs preview width. Default is 0.4
83+
8084--- @class TaskfileConfig
81- --- @field windows ? { output ?: WindowConfig , list ?: WindowConfig } # Floating window layouts
85+ --- @field windows ? { output ?: WindowConfig , list ?: ListWindowConfig } # Floating window layouts
8286--- @field scroll ? { auto ?: boolean } # Auto-scroll output to the bottom
8387--- @field keymaps ? { rerun ?: string } # Keymap configuration for commands like rerun
8488--- Setup the Taskfile plugin
@@ -92,6 +96,14 @@ M.setup = function(opts)
9296 })
9397 M ._options = vim .tbl_deep_extend (" force" , {}, config , opts or {})
9498
99+ utils .validate_range ({
100+ [" windows.output.width" ] = M ._options .windows .output .width ,
101+ [" windows.output.height" ] = M ._options .windows .output .height ,
102+ [" windows.list.width" ] = M ._options .windows .list .width ,
103+ [" windows.list.height" ] = M ._options .windows .list .height ,
104+ [" windows.list.width_ratio" ] = M ._options .windows .list .width_ratio ,
105+ }, 0 , 1 )
106+
95107 if M ._options .keymaps ~= false then
96108 setup_global_keymaps ()
97109 end
@@ -169,7 +181,7 @@ M.close_task_output_window = function()
169181end
170182
171183--- Return the window configuration for the list
172- --- @return WindowConfig
184+ --- @return ListWindowConfig
173185M .get_list_config = function ()
174186 return M ._options .windows .list
175187end
0 commit comments