<commit_before>ProviderBase = require './provider-base'
{Point} = require 'atom'
{limitNumber} = require '../utils'

# Borrowed from git-diff core pacakge.
repositoryForPath = (goalPath) ->
  for directory, i in atom.project.getDirectories()
    if goalPath is directory.getPath() or directory.contains(goalPath)
      return atom.project.getRepositories()[i]
  null

module.exports =
class GitDiff extends ProviderBase
  refresh: ->
    @items = []<commit_msg>Improve, GitDiff should aware of buffer change<commit_after>ProviderBase = require './provider-base'
{Point} = require 'atom'
{limitNumber} = require '../utils'

# Borrowed from git-diff core pacakge.
repositoryForPath = (goalPath) ->
  for directory, i in atom.project.getDirectories()
    if goalPath is directory.getPath() or directory.contains(goalPath)
      return atom.project.getRepositories()[i]
  null

module.exports =
class GitDiff extends ProviderBase
  initialize: ->
    @subscribe @editor.onDidStopChanging(@refresh)

  refresh: =>
    @items = null
{'fraction_non_alphanumeric': 0.11695906432748537, 'fraction_numerical': 0.0, 'mean_word_length': 4.4338624338624335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6618238', 'n_tokens_mistral': 310, 'n_tokens_neox': 301, 'n_words': 84}