<commit_before>package com.intellij.openapi.editor.impl;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandAdapter;
import com.intellij.openapi.command.CommandEvent;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;

import java.util.HashSet;
import java.util.Set;

public class VisibleEditorsTracker extends CommandAdapter implements ApplicationComponent{
  private Set<Editor> myEditorsVisibleOnCommandStart = new HashSet<Editor>();
  private long myCurrentCommandStart;
  private long myLastCommandFinish;

  public static VisibleEditorsTracker getInstance() {
    return ApplicationManager.getApplication().getComponent(VisibleEditorsTracker.class);
  }


  public VisibleEditorsTracker(CommandProcessor commandProcessor) {
    commandProcessor.addCommandListener(this);
  }

  public String getComponentName() {
    return "VisibleEditorsTracker";
  }

  public void initComponent() {
  }

  public void disposeComponent() {
  }

  public boolean wasEditorVisibleOnCommandStart(Editor editor){
    return myEditorsVisibleOnCommandStart.contains(editor);
  }

  public long getCurrentCommandStart() { return myCurrentCommandStart; }

  public long getLastCommandFinish() { return myLastCommandFinish; }

  public void commandStarted(CommandEvent event) {
    Editor[] editors = EditorFactory.getInstance().getAllEditors();
    for (int i = 0; i < editors.length; i++) {
      Editor editor = editors[i];

      if (editor.getComponent().isShowing()){
        myEditorsVisibleOnCommandStart.add(editor);
      }

      ((ScrollingModelImpl)editor.getScrollingModel()).commandStarted();
      myCurrentCommandStart = System.currentTimeMillis();
    }
  }

  public void commandFinished(CommandEvent event) {
    myEditorsVisibleOnCommandStart.clear();
    myLastCommandFinish = System.currentTimeMillis();
  }
}<commit_msg>cleanup<commit_after>package com.intellij.openapi.editor.impl;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandAdapter;
import com.intellij.openapi.command.CommandEvent;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;

import java.util.HashSet;
import java.util.Set;

import org.jetbrains.annotations.NotNull;

public class VisibleEditorsTracker extends CommandAdapter implements ApplicationComponent{
  private Set<Editor> myEditorsVisibleOnCommandStart = new HashSet<Editor>();
  private long myCurrentCommandStart;
  private long myLastCommandFinish;

  public static VisibleEditorsTracker getInstance() {
    return ApplicationManager.getApplication().getComponent(VisibleEditorsTracker.class);
  }


  public VisibleEditorsTracker(CommandProcessor commandProcessor) {
    commandProcessor.addCommandListener(this);
  }

  @NotNull
  public String getComponentName() {
    return "VisibleEditorsTracker";
  }

  public void initComponent() {
  }

  public void disposeComponent() {
  }

  public boolean wasEditorVisibleOnCommandStart(Editor editor){
    return myEditorsVisibleOnCommandStart.contains(editor);
  }

  public long getCurrentCommandStart() { return myCurrentCommandStart; }

  public long getLastCommandFinish() { return myLastCommandFinish; }

  public void commandStarted(CommandEvent event) {
    Editor[] editors = EditorFactory.getInstance().getAllEditors();
    for (Editor editor : editors) {
      if (editor.getComponent().isShowing()) {
        myEditorsVisibleOnCommandStart.add(editor);
      }

      ((ScrollingModelImpl)editor.getScrollingModel()).commandStarted();
      myCurrentCommandStart = System.currentTimeMillis();
    }
  }

  public void commandFinished(CommandEvent event) {
    myEditorsVisibleOnCommandStart.clear();
    myLastCommandFinish = System.currentTimeMillis();
  }
}
{'fraction_non_alphanumeric': 0.09001716948736817, 'fraction_numerical': 0.0002452783909737552, 'mean_word_length': 5.462757527733756, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4044595', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1098, 'n_words': 207}