<commit_before>{CompositeDisposable} = require 'atom'

UI = require './ui'
Lines = require './provider/lines'
Search = require './provider/search'
Fold = require './provider/fold'
Input = require './input'
settings = require './settings'

module.exports =
  config: settings.config

  activate: ->
    @subscriptions = new CompositeDisposable
    settings.removeDeprecated()
    @input = new Input

    currentWord = @getCurrentWord.bind(this)
    @subscribe atom.commands.add 'atom-workspace',
      'narrow:lines': => @lines()
      'narrow:lines-by-current-word': => @lines(currentWord())

      'narrow:fold': => @fold()
      'narrow:fold-by-current-word': => @fold(currentWord())

      'narrow:search': => @search()
      'narrow:search-by-current-word': => @search(currentWord())

      'narrow:search-current-project': => @searchCurrentProject()
      'narrow:search-current-project-by-current-word': => @searchCurrentProject(currentWord())

      'narrow:focus': => @ui.focus()

  subscribe: (arg) ->
    @subscriptions.add arg

  # Return currently selected text or word under cursor.
  getCurrentWord: ->
    editor = atom.workspace.getActiveTextEditor()
    selection = editor.getLastSelection()
    {cursor} = selection<commit_msg>cleanup<commit_after>{CompositeDisposable} = require 'atom'

UI = require './ui'
Lines = require './provider/lines'
Search = require './provider/search'
Fold = require './provider/fold'
Input = require './input'
settings = require './settings'

module.exports =
  config: settings.config

  activate: ->
    @subscriptions = new CompositeDisposable
    settings.removeDeprecated()
    @input = new Input

    getCurrentWord = @getCurrentWord.bind(this)
    @subscribe atom.commands.add 'atom-workspace',
      'narrow:lines': => @lines()
      'narrow:lines-by-current-word': => @lines(getCurrentWord())

      'narrow:fold': => @fold()
      'narrow:fold-by-current-word': => @fold(getCurrentWord())

      'narrow:search': => @search()
      'narrow:search-by-current-word': => @search(getCurrentWord())

      'narrow:search-current-project': => @searchCurrentProject()
      'narrow:search-current-project-by-current-word': => @searchCurrentProject(getCurrentWord())

      'narrow:focus': => @ui.focus()

  subscribe: (arg) ->
    @subscriptions.add arg

  # Return currently selected text or word under cursor.
  getCurrentWord: ->
    editor = atom.workspace.getActiveTextEditor()
    selection = editor.getLastSelection()
    {cursor} = selection
{'fraction_non_alphanumeric': 0.15766306522609044, 'fraction_numerical': 0.0, 'mean_word_length': 3.854368932038835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '4843938', 'n_tokens_mistral': 752, 'n_tokens_neox': 733, 'n_words': 147}