<commit_before>"======================================
"    Script Name:  vim-auto-save (http://www.vim.org/scripts/script.php?script_id=4521)
"    Plugin Name:  AutoSave
"        Version:  0.1.6
"======================================

if exists("g:auto_save_loaded")
  finish
else
  let g:auto_save_loaded = 1
endif

let s:save_cpo = &cpo
set cpo&vim

if !exists("g:auto_save")
  let g:auto_save = 0
endif

if !exists("g:auto_save_no_updatetime")
  let g:auto_save_no_updatetime = 0
endif

if !exists("g:auto_save_in_insert_mode")
  let g:auto_save_in_insert_mode = 1
endif

if g:auto_save_no_updatetime == 0
  set updatetime=200
endif

if !exists("g:auto_save_silent")
  let g:auto_save_silent = 0
endif

augroup auto_save
  autocmd!
  if g:auto_save_in_insert_mode == 1
    au CursorHoldI,CompleteDone * call AutoSave()
  endif

  au CursorHold,InsertLeave * call AutoSave()
augroup END

command! AutoSaveToggle :call AutoSaveToggle()

function! AutoSave()
  if g:auto_save >= 1
    let was_modified = &modified
    silent! wa
    if was_modified && !&modified && g:auto_save_silent == 0
      if exists("g:auto_save_postsave_hook")
        execute "" . g:auto_save_postsave_hook
      endif
      echo "(AutoSaved at " . strftime("%H:%M:%S") . ")"<commit_msg>Fix #9: Allow recursive aucmds using 'nested' keyword<commit_after>"======================================
"    Script Name:  vim-auto-save (http://www.vim.org/scripts/script.php?script_id=4521)
"    Plugin Name:  AutoSave
"        Version:  0.1.7
"======================================

if exists("g:auto_save_loaded")
  finish
else
  let g:auto_save_loaded = 1
endif

let s:save_cpo = &cpo
set cpo&vim

if !exists("g:auto_save")
  let g:auto_save = 0
endif

if !exists("g:auto_save_no_updatetime")
  let g:auto_save_no_updatetime = 0
endif

if !exists("g:auto_save_in_insert_mode")
  let g:auto_save_in_insert_mode = 1
endif

if g:auto_save_no_updatetime == 0
  set updatetime=200
endif

if !exists("g:auto_save_silent")
  let g:auto_save_silent = 0
endif

augroup auto_save
  autocmd!
  if g:auto_save_in_insert_mode == 1
    au CursorHoldI,CompleteDone * nested call AutoSave()
  endif
  au CursorHold,InsertLeave * nested call AutoSave()
augroup END

command! AutoSaveToggle :call AutoSaveToggle()

function! AutoSave()
  if g:auto_save >= 1
    let was_modified = &modified
    silent! wa
    if was_modified && !&modified && g:auto_save_silent == 0
      if exists("g:auto_save_postsave_hook")
        execute "" . g:auto_save_postsave_hook
      endif
      echo "(AutoSaved at " . strftime("%H:%M:%S") . ")"
{'fraction_non_alphanumeric': 0.16427741185586983, 'fraction_numerical': 0.015110422316931422, 'mean_word_length': 4.528907922912206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6050828', 'n_tokens_mistral': 977, 'n_tokens_neox': 926, 'n_words': 205}