diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-10 20:56:58 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-10 20:56:58 +0200 |
commit | be5ee8686a50acf07b823bd293f9c765e533d213 (patch) | |
tree | fc5056db66c81eefa83a30afae305b9b027677d8 /src/testdir/test_autocmd.vim | |
parent | 6ba24d87630b1ec2b8c7ff71550c9e41d143800e (diff) | |
download | vim-git-be5ee8686a50acf07b823bd293f9c765e533d213.tar.gz |
patch 8.2.0952: no simple way to interrupt Vimv8.2.0952
Problem: No simple way to interrupt Vim.
Solution: Add the SigUSR1 autocommand, triggered by SIGUSR1. (Jacob Hayes,
closes #1718)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index b7a523e39..9ac707005 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -2509,4 +2509,17 @@ func Test_autocmd_deep_nesting() autocmd! BufEnter Xfile endfunc +" Tests for SigUSR1 autocmd event, which is only available on posix systems. +func Test_autocmd_sigusr1() + CheckUnix + + let g:sigusr1_passed = 0 + au SigUSR1 * let g:sigusr1_passed = 1 + call system('/bin/kill -s usr1 ' . getpid()) + call WaitForAssert({-> assert_true(g:sigusr1_passed)}) + + au! SigUSR1 + unlet g:sigusr1_passed +endfunc + " vim: shiftwidth=2 sts=2 expandtab |