Animations like the ones suggested in #132 should not need to be hard-coded into our spinner library, since they just involve translating a static string across an empty space. Such animation frames can easily be generated with something like this:
-- UNTESTED CODE btw
local function bouncer(icon, width)
local frames = {}
local padding = width - vim.fn.strdisplaywidth(icon)
assert(padding > 0)
for i=0, padding do
table.insert(frames, string.format("%s%s%s", string.rep(" ", i), icon, string.rep(" ", width - i))
end
for i=1, padding do
table.insert(frames, string.format("%s%s%s", string.rep(" ", width - i), icon, string.rep(" ", width))
end
return frames
end
This kind of thing can and should be added to spinner as a combinator so that users can roll their own anime
Other combinator ideas (resurrect HTML tags with vengeance):
Fidget could even support animated epic gamer highlights (though this will require supporting _style fields as functions):
Animations like the ones suggested in #132 should not need to be hard-coded into our spinner library, since they just involve translating a static string across an empty space. Such animation frames can easily be generated with something like this:
This kind of thing can and should be added to
spinneras a combinator so that users can roll their own animeOther combinator ideas (resurrect HTML tags with vengeance):
<marquee>-style scrolling text<blink>-style blinkersFidget could even support animated epic gamer highlights (though this will require supporting
_stylefields as functions):