<commit_before>RangeFinder = require './range-finder'

module.exports =
  activate: ->
    atom.workspaceView.command 'sort-lines:sort', '.editor', ->
      editor = atom.workspace.getActiveEditor()
      sortLines(editor)

    atom.workspaceView.command 'sort-lines:reverse-sort', '.editor', ->
      editor = atom.workspace.getActiveEditor()
      sortLinesReversed(editor)

    atom.workspaceView.command 'sort-lines:unique', '.editor', ->
      editor = atom.workspace.getActiveEditor()
      uniqueLines(editor)

    atom.workspaceView.command 'sort-lines:case-insensitive-sort', '.editor', ->
      editor = atom.workspaceView.getActivePaneItem()
      sortLinesInsensitive(editor)

sortLines = (editor) ->
  sortableRanges = RangeFinder.rangesFor(editor)<commit_msg>Obtain editor from atom.workspace<commit_after>RangeFinder = require './range-finder'

module.exports =
  activate: ->
    atom.workspaceView.command 'sort-lines:sort', '.editor', ->
      editor = atom.workspace.getActiveEditor()
      sortLines(editor)

    atom.workspaceView.command 'sort-lines:reverse-sort', '.editor', ->
      editor = atom.workspace.getActiveEditor()
      sortLinesReversed(editor)

    atom.workspaceView.command 'sort-lines:unique', '.editor', ->
      editor = atom.workspace.getActiveEditor()
      uniqueLines(editor)

    atom.workspaceView.command 'sort-lines:case-insensitive-sort', '.editor', ->
      editor = atom.workspace.getActiveEditor()
      sortLinesInsensitive(editor)

sortLines = (editor) ->
  sortableRanges = RangeFinder.rangesFor(editor)
{'fraction_non_alphanumeric': 0.13653846153846153, 'fraction_numerical': 0.0, 'mean_word_length': 3.8934169278996866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1164658', 'n_tokens_mistral': 466, 'n_tokens_neox': 461, 'n_words': 68}