@Override
      public void currentVariableChanged(@NotNull TemplateState templateState, Template template, int oldIndex, int newIndex) {
        maxEditedVariable.set(Math.max(maxEditedVariable.get(), oldIndex));
      }
@Override
      public void currentVariableChanged(@NotNull TemplateState templateState, Template template, int oldIndex, int newIndex)