@Override
      public boolean tryChangeEncoding(@NotNull Charset charset) {

        if (fileManager.hasBOM()) {
          Messages.showWarningDialog(
            EditorBundle.message("large.file.editor.message.cant.change.encoding.because.it.has.bom.byte.order.mark"),
            EditorBundle.message("large.file.editor.title.warning"));
          return false;
        }

        if (searchManager.isSearchWorkingNow()) {
          Messages.showInfoMessage(EditorBundle.message("large.file.editor.message.cant.change.encoding.because.search.is.working.now"),
                                   EditorBundle.message("large.file.editor.title.cant.change.encoding"));
          return false;
        }

        fileManager.reset(charset);
        editorModel.onEncodingChanged();
        return true;
      }
@Override
      public boolean tryChangeEncoding(@NotNull Charset charset)