Moves a later name
key value pair in multi-value block map definition to the top of its body (e.g. value with -
prefix), easily changable to other keys and indent levels.
Indent size is assumed to be 2.
Indent level of names being hoisted is controlled by capture group $1
, which is later referenced by $5
, the indent level of all other properties
Other properties can be hoisted by replacing the two instances of name
in the pattern. A couple inputs for simple nested, folded, and literal values (immediately after these notes) seem to work.
Syntax level comments in captures will probably need to be rearranged after applying this, and worst case (especially comments lower indents) break matching