<commit_before>" Vim global plugin for semantic highlighting using libclang
" Maintainer:	Jeaye <<EMAIL>>

" ------------------------------------------------------------------------------
if v:version < 704 || !exists("*matchaddpos")
  echohl WarningMsg |
        \ echomsg "color_coded unavailable: requires Vim 7.4p330+" |
        \ echohl None
  finish
endif
if !has('lua')
  echohl WarningMsg |
        \ echomsg "color_coded unavailable: requires lua" |
        \ echohl None
  finish
endif
if exists("g:loaded_color_coded") || &cp
  finish
endif
" ------------------------------------------------------------------------------

let g:loaded_color_coded = 1
let s:keepcpo = &cpo
set cpo&vim
" ------------------------------------------------------------------------------

if !exists("g:color_coded_filetypes")
  let g:color_coded_filetypes = ['c', 'h', 'cpp', 'hpp', 'cc', 'm', 'mm']
endif

let s:path = expand('<sfile>:p:h')
lua << EOF
  package.cpath = package.cpath ..
                  ";" .. vim.eval("s:path") .. "/../bin/color_coded.so"
  require("color_coded")
  function color_coded_buffer_name()
    name = vim.buffer().name
    if (name == nil or name == '') then
      name = tostring(vim.buffer().number)
    end
    return name
  end

  function color_coded_buffer_details()
    name = color_coded_buffer_name()

    line_count = #vim.buffer()
    data = ''
    for i = 1,line_count do
      data = data .. vim.buffer()[i] .. "\n"
    end
    return name, data
  end
EOF

function! s:color_coded_push()
  if index(g:color_coded_filetypes, &ft) < 0
    return
  endif
lua << EOF
  name, data = color_coded_buffer_details()
  color_coded_push(name, data)
EOF<commit_msg>Always use full buffer names<commit_after>" Vim global plugin for semantic highlighting using libclang
" Maintainer:	Jeaye <<EMAIL>>

" ------------------------------------------------------------------------------
if v:version < 704 || !exists("*matchaddpos")
  echohl WarningMsg |
        \ echomsg "color_coded unavailable: requires Vim 7.4p330+" |
        \ echohl None
  finish
endif
if !has('lua')
  echohl WarningMsg |
        \ echomsg "color_coded unavailable: requires lua" |
        \ echohl None
  finish
endif
if exists("g:loaded_color_coded") || &cp
  finish
endif
" ------------------------------------------------------------------------------

let g:loaded_color_coded = 1
let s:keepcpo = &cpo
set cpo&vim
" ------------------------------------------------------------------------------

if !exists("g:color_coded_filetypes")
  let g:color_coded_filetypes = ['c', 'h', 'cpp', 'hpp', 'cc', 'm', 'mm']
endif

let s:path = expand('<sfile>:p:h')
lua << EOF
  package.cpath = package.cpath ..
                  ";" .. vim.eval("s:path") .. "/../bin/color_coded.so"
  require("color_coded")
  function color_coded_buffer_name()
    name = vim.buffer().fname
    if (name == nil or name == '') then
      name = tostring(vim.buffer().number)
    end
    return name
  end

  function color_coded_buffer_details()
    name = color_coded_buffer_name()

    line_count = #vim.buffer()
    data = ''
    for i = 1,line_count do
      data = data .. vim.buffer()[i] .. "\n"
    end
    return name, data
  end
EOF

function! s:color_coded_push()
  if index(g:color_coded_filetypes, &ft) < 0
    return
  endif
lua << EOF
  name, data = color_coded_buffer_details()
  color_coded_push(name, data)
EOF
{'fraction_non_alphanumeric': 0.25589622641509435, 'fraction_numerical': 0.006485849056603774, 'mean_word_length': 1.902480752780154, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 9, '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': '1643282', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1027, 'n_words': 261}