CodeInput.indentRope

Get a rope representing given indent level.

class CodeInput
const
indentRope
(
int indentLevel = 1
)

Examples

indentRope outputs tabs if .useTabs is set.

auto root = codeInput(.useTabs);

assert(root.indentRope == "\t");
assert(root.indentRope(2) == "\t\t");
assert(root.indentRope(3) == "\t\t\t");

indentRope outputs series of spaces if spaces are used for indents. This is the default behavior.

auto root = codeInput();

assert(root.indentRope == "    ");
assert(root.indentRope(2) == "        ");
assert(root.indentRope(3) == "            ");

Meta