<commit_before>" ~/.vim/autoload/filetype.vim

function! s:AddCommand(varname, command, rest) abort
  let l:args = get(a:rest, 0, [])
  let l:commands = s:ExpandCommand(a:command, l:args)
  if exists(a:varname)
    call insert(l:commands, {a:varname})
  endif
  let {a:varname} = join(l:commands, '|')
endfunction

function! s:ExpandCommand(command, args) abort
  if !empty(a:args)
    return map(copy(a:args), 'join([a:command, v:val])')
  endif
  return [a:command]
endfunction

function! filetype#UndoPlugin(command, ...) abort
  call s:AddCommand('b:undo_ftplugin', a:command, a:000)
endfunction

function! filetype#UndoIndent(command, ...) abort
  call s:AddCommand('b:undo_indent', a:command, a:000)
endfunction

function! filetype#Ensure(filetype) abort
  if &filetype is# a:filetype
    " Don't trigger FileType event again for the same file type.
    return
  endif
  let &filetype = a:filetype
endfunction
<commit_msg>Check did_filetype() result in filetype#Ensure()<commit_after>" ~/.vim/autoload/filetype.vim

function! s:AddCommand(varname, command, rest) abort
  let l:args = get(a:rest, 0, [])
  let l:commands = s:ExpandCommand(a:command, l:args)
  if exists(a:varname)
    call insert(l:commands, {a:varname})
  endif
  let {a:varname} = join(l:commands, '|')
endfunction

function! s:ExpandCommand(command, args) abort
  if !empty(a:args)
    return map(copy(a:args), 'join([a:command, v:val])')
  endif
  return [a:command]
endfunction

function! filetype#UndoPlugin(command, ...) abort
  call s:AddCommand('b:undo_ftplugin', a:command, a:000)
endfunction

function! filetype#UndoIndent(command, ...) abort
  call s:AddCommand('b:undo_indent', a:command, a:000)
endfunction

function! filetype#Ensure(filetype) abort
  if &filetype is# a:filetype && did_filetype()
    " Don't trigger FileType event again for the same file type.
    return
  endif
  let &filetype = a:filetype
endfunction

{'fraction_non_alphanumeric': 0.14091147197485596, 'fraction_numerical': 0.007333682556312206, 'mean_word_length': 5.3879598662207355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1043815', 'n_tokens_mistral': 710, 'n_tokens_neox': 682, 'n_words': 161}