<commit_before>" MIT License. Copyright (c) 2013 <NAME>.
" vim: et ts=2 sts=2 sw=2

function! s:check_defined(variable, default)
  if !exists(a:variable)
    let {a:variable} = a:default
  endif
endfunction

call s:check_defined('g:airline#extensions#hunks#non_zero_only', 0)
call s:check_defined('g:airline#extensions#hunks#hunk_symbols', ['+', '~', '-'])

function! airline#extensions#hunks#get_hunks()
  let hunks = GitGutterGetHunkSummary()
  let string = ''
  for i in [0, 1, 2]
    if g:airline#extensions#hunks#non_zero_only == 0 || hunks[i] > 0
      let string .= printf('%s%s ', g:airline#extensions#hunks#hunk_symbols[i], hunks[i])
    endif
  endfor
  return string
endfunction

function! airline#extensions#hunks#init(ext)
  let g:airline_section_b .= '%{airline#extensions#hunks#get_hunks()}'
endfunction
<commit_msg>simplify, no globals unless necessary.<commit_after>" MIT License. Copyright (c) 2013 <NAME>.
" vim: et ts=2 sts=2 sw=2

let s:non_zero_only = get(g:, 'airline#extensions#hunks#non_zero_only', 0)
let s:hunk_symbols = get(g:, 'airline#extensions#hunks#hunk_symbols', ['+', '~', '-'])

function! airline#extensions#hunks#get_hunks()
  let hunks = GitGutterGetHunkSummary()
  let string = ''
  for i in [0, 1, 2]
    if s:non_zero_only == 0 || hunks[i] > 0
      let string .= printf('%s%s ', s:hunk_symbols[i], hunks[i])
    endif
  endfor
  return string
endfunction

function! airline#extensions#hunks#init(ext)
  let g:airline_section_b .= '%{airline#extensions#hunks#get_hunks()}'
endfunction

{'fraction_non_alphanumeric': 0.1559633027522936, 'fraction_numerical': 0.01703800786369594, 'mean_word_length': 5.697368421052632, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1868811', 'n_tokens_mistral': 626, 'n_tokens_neox': 577, 'n_words': 120}