<commit_before>/** @babel */

import {Disposable} from 'atom'

export default class GrammarStatusView {
  constructor (statusBar) {
    this.statusBar = statusBar
    this.element = document.createElement('grammar-selector-status')
    this.element.classList.add('grammar-status', 'inline-block')
    this.grammarLink = document.createElement('a')
    this.grammarLink.classList.add('inline-block')
    this.element.appendChild(this.grammarLink)
    this.activeItemSubscription = atom.workspace.observeActivePaneItem(this.subscribeToActiveTextEditor.bind(this))
    this.configSubscription = atom.config.observe('grammar-selector.showOnRightSideOfStatusBar', this.attach.bind(this))
    const clickHandler = (event) => {
      event.preventDefault()
      atom.commands.dispatch(atom.views.getView(atom.workspace.getActiveTextEditor()), 'grammar-selector:show')
    }
    this.element.addEventListener('click', clickHandler)
    this.clickSubscription = new Disposable(() => { this.element.removeEventListener('click', clickHandler) })
  }
<commit_msg>Use observeActiveTextEditor instead of observeActivePaneItem<commit_after>/** @babel */

import {Disposable} from 'atom'

export default class GrammarStatusView {
  constructor (statusBar) {
    this.statusBar = statusBar
    this.element = document.createElement('grammar-selector-status')
    this.element.classList.add('grammar-status', 'inline-block')
    this.grammarLink = document.createElement('a')
    this.grammarLink.classList.add('inline-block')
    this.element.appendChild(this.grammarLink)
    this.activeItemSubscription = atom.workspace.observeActiveTextEditor(this.subscribeToActiveTextEditor.bind(this))
    this.configSubscription = atom.config.observe('grammar-selector.showOnRightSideOfStatusBar', this.attach.bind(this))
    const clickHandler = (event) => {
      event.preventDefault()
      atom.commands.dispatch(atom.views.getView(atom.workspace.getActiveTextEditor()), 'grammar-selector:show')
    }
    this.element.addEventListener('click', clickHandler)
    this.clickSubscription = new Disposable(() => { this.element.removeEventListener('click', clickHandler) })
  }

{'fraction_non_alphanumeric': 0.12726428239665583, 'fraction_numerical': 0.0, 'mean_word_length': 5.279883381924198, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5739060', 'n_tokens_mistral': 603, 'n_tokens_neox': 608, 'n_words': 84}