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

module.exports =
  activate: (state) ->
    atom.workspaceView.command 'sort-lines:sort', '.editor', =>
      editor = atom.workspaceView.getActivePaneItem()
      @sortLines(editor)

  sortLines: (editor) ->
    lineRanges = RangeFinder.rangesFor(editor)
    lineRanges.forEach (lineRange) ->
      textLines = editor.getTextInBufferRange(lineRange).split("\n")
      textLines.sort (a, b) -> a.localeCompare(b)
      editor.setTextInBufferRange(lineRange, textLines.join("\n"))
<commit_msg>Rename variable to increase clarity<commit_after>RangeFinder = require './range-finder'

module.exports =
  activate: (state) ->
    atom.workspaceView.command 'sort-lines:sort', '.editor', =>
      editor = atom.workspaceView.getActivePaneItem()
      @sortLines(editor)

  sortLines: (editor) ->
    sortableRanges = RangeFinder.rangesFor(editor)
    sortableRanges.forEach (range) ->
      textLines = editor.getTextInBufferRange(range).split("\n")
      textLines.sort (a, b) -> a.localeCompare(b)
      editor.setTextInBufferRange(range, textLines.join("\n"))

{'fraction_non_alphanumeric': 0.14388489208633093, 'fraction_numerical': 0.0, 'mean_word_length': 4.036199095022624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4379407', 'n_tokens_mistral': 343, 'n_tokens_neox': 344, 'n_words': 56}