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

scriptencoding utf-8

let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
let s:fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
let s:buf_modified_symbol = g:airline_symbols.modified

function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
  let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
  let _ = ''

  let name = bufname(a:bufnr)
  if empty(name)
    let _ .= '[No Name]'
  elseif name =~ 'term://'
    " Neovim Terminal
    let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
  else
    if s:fnamecollapse
      " Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c'
      "let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
      let _ .= pathshorten(fnamemodify(name, fmod))
    else
      let _ .= fnamemodify(name, fmod)
    endif
    if a:bufnr != bufnr('%') && s:fnametruncate && strlen(_) > s:fnametruncate
      let _ = strpart(_, 0, s:fnametruncate)
    endif
  endif

  return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)
endfunction

function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name)
  let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : ''
  let _ .= substitute(a:buffer_name, '\\', '/', 'g')

  if getbufvar(a:bufnr, '&modified') == 1
    let _ .= s:buf_modified_symbol
  endif
  return _
endfunction<commit_msg>tabline: get rid of s:vars in default formatter<commit_after>" MIT License. Copyright (c) 2013-2020 <NAME> et al.
" vim: et ts=2 sts=2 sw=2

scriptencoding utf-8

function! airline#extensions#tabline#formatters#default#format(bufnr, buffers)
  let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0)
  let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
  let _ = ''

  let name = bufname(a:bufnr)
  if empty(name)
    let _ .= '[No Name]'
  elseif name =~ 'term://'
    " Neovim Terminal
    let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '')
  else
    if get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
      " Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c'
      "let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
      let _ .= pathshorten(fnamemodify(name, fmod))
    else
      let _ .= fnamemodify(name, fmod)
    endif
    if a:bufnr != bufnr('%') && fnametruncate && strlen(_) > fnametruncate
      let _ = strpart(_, 0, fnametruncate)
    endif
  endif

  return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _)
endfunction

function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name)
  let buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
  let buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
  let buf_modified_symbol = g:airline_symbols.modified

  let _ = buf_nr_show ? printf(buf_nr_format, a:bufnr) : ''
  let _ .= substitute(a:buffer_name, '\\', '/', 'g')

  if getbufvar(a:bufnr, '&modified') == 1
    let _ .= buf_modified_symbol
  endif
  return _
endfunction
{'fraction_non_alphanumeric': 0.16607248960190138, 'fraction_numerical': 0.0112893642305407, 'mean_word_length': 4.344444444444444, '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': '6099771', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1294, 'n_words': 249}