view src/testdir/test_interrupt.vim @ 33646:314ef6fe82e8 v9.0.2063

patch 9.0.2063: pacman hooks are detected as conf filetype Commit: https://github.com/vim/vim/commit/7d254dbc2db35badc65668db85f826f605486986 Author: Guido Cella <guido@guidocella.xyz> Date: Mon Oct 23 19:27:06 2023 +0200 patch 9.0.2063: pacman hooks are detected as conf filetype Problem: pacman hooks are detected as conf filetype Solution: make it consistent to pacman.conf and detect those hooks as confini Because confini has much better syntax highlighting than conf. For reference, I identified pacman.conf and pacman hooks as dosini in https://github.com/vim/vim/pull/6335, then https://github.com/vim/vim/pull/10213 changed them to conf, then https://github.com/vim/vim/pull/10518 changed pacman.conf to confini but forgot to change hooks. closes: #13399 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Guido Cella <guido@guidocella.xyz>
author Christian Brabandt <cb@256bit.org>
date Mon, 23 Oct 2023 19:30:09 +0200
parents 860f148e7a64
children
line wrap: on
line source

" Test behavior of interrupt()

let s:bufwritepre_called = 0
let s:bufwritepost_called = 0

func s:bufwritepre()
  let s:bufwritepre_called = 1
  call interrupt()
endfunction

func s:bufwritepost()
  let s:bufwritepost_called = 1
endfunction

func Test_interrupt()
  new Xinterrupt
  let n = 0
  try
    au BufWritePre Xinterrupt call s:bufwritepre()
    au BufWritePost Xinterrupt call s:bufwritepost()
    w!
  catch /^Vim:Interrupt$/
  endtry
  call assert_equal(1, s:bufwritepre_called)
  call assert_equal(0, s:bufwritepost_called)
  call assert_equal(0, filereadable('Xinterrupt'))

  au! BufWritePre
  au! BufWritePost
endfunc

" vim: shiftwidth=2 sts=2 expandtab