import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { repeat } = fn;
Repeat {expr} {count} times and return the concatenated result. Example:
:let separator = repeat('-', 80)
When {count} is zero or negative the result is empty.
When {expr} is a List
or a Blob
the result is {expr}
concatenated {count} times. Example:
:let longlist = repeat(['a', 'b'], 3)
Results in ['a', 'b', 'a', 'b', 'a', 'b'].
Can also be used as a method
:
mylist->repeat(count)