Make wrapped strategy in Christmas optional

Defaults to the global strategy.
This commit is contained in:
HiPhish 2024-08-08 19:22:40 +02:00
parent 361193faea
commit 254c67c8c6

View file

@ -35,10 +35,11 @@ end
---Wraps the given strategy with a new strategy that switches colours like a
---chain of Christmas lights.
---@param strategy rainbow_delimiters.strategy The original strategy
---@param strategy rainbow_delimiters.strategy? Original strategy (default global)
---@param delay integer? Time between switches in milliseconds (default 500)
---@return rainbow_delimiters.strategy christmas_lights A new strategy object
function M.lights(strategy, delay)
strategy = strategy or require 'rainbow-delimiters.strategy.global'
delay = delay or 500
local timer = uv.new_timer()