@Override
      public void templateFinished(@NotNull Template template, boolean brokenOff) {
        if (brokenOff) {
          ApplicationManager.getApplication().runWriteAction(() -> {
            if (rangeMarker.isValid()) {
              document.replaceString(rangeMarker.getStartOffset(), rangeMarker.getEndOffset(), originalText);
              editor.getCaretModel().moveToOffset(rangeMarker.getStartOffset() + typeInfo.originalOffset);
            }
          });
        }
      }
@Override
      public void templateFinished(@NotNull Template template, boolean brokenOff)