findUniqueNameFor

private fun findUniqueNameFor(template: Template): String(source)

Finds a good, unique name for template so that it can be inserted into this list without conflict.

If the name is already unique, that name is returned. Otherwise, the name is appended with the first number i such that $name ($i) is unique. If the template's current name already ends with a number in parentheses, that number is taken as the starting number.