Mercurial > vim
comparison src/testdir/test_autocmd.vim @ 16646:ea0f9a2df961 v8.1.1325
patch 8.1.1325: cannot build with +eval but without +channel and +timers
commit https://github.com/vim/vim/commit/97b0075b0d733cc58c29247b09e7887b9991d7bf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 12 13:07:14 2019 +0200
patch 8.1.1325: cannot build with +eval but without +channel and +timers
Problem: Cannot build with +eval but without +channel and +timers. (John
Marriott)
Solution: Adjust #ifdef for get_callback().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 May 2019 13:15:06 +0200 |
parents | 24233eeaadd0 |
children | 9c90cf08cfa8 |
comparison
equal
deleted
inserted
replaced
16645:6453e4aec575 | 16646:ea0f9a2df961 |
---|---|
16 " This script will never reach the main loop, can't check if v:vim_did_enter | 16 " This script will never reach the main loop, can't check if v:vim_did_enter |
17 " becomes one. | 17 " becomes one. |
18 endfunc | 18 endfunc |
19 | 19 |
20 if has('timers') | 20 if has('timers') |
21 | |
21 func ExitInsertMode(id) | 22 func ExitInsertMode(id) |
22 call feedkeys("\<Esc>") | 23 call feedkeys("\<Esc>") |
23 endfunc | 24 endfunc |
24 | 25 |
25 func Test_cursorhold_insert() | 26 func Test_cursorhold_insert() |
68 call assert_equal(0, g:triggered) | 69 call assert_equal(0, g:triggered) |
69 unlet g:triggered | 70 unlet g:triggered |
70 au! CursorHoldI | 71 au! CursorHoldI |
71 set updatetime& | 72 set updatetime& |
72 endfunc | 73 endfunc |
73 endif | 74 |
75 func Test_OptionSet_modeline() | |
76 call test_override('starting', 1) | |
77 au! OptionSet | |
78 augroup set_tabstop | |
79 au OptionSet tabstop call timer_start(1, {-> execute("echo 'Handler called'", "")}) | |
80 augroup END | |
81 call writefile(['vim: set ts=7 sw=5 :', 'something'], 'XoptionsetModeline') | |
82 set modeline | |
83 let v:errmsg = '' | |
84 call assert_fails('split XoptionsetModeline', 'E12:') | |
85 call assert_equal(7, &ts) | |
86 call assert_equal('', v:errmsg) | |
87 | |
88 augroup set_tabstop | |
89 au! | |
90 augroup END | |
91 bwipe! | |
92 set ts& | |
93 call delete('XoptionsetModeline') | |
94 call test_override('starting', 0) | |
95 endfunc | |
96 | |
97 endif "has('timers') | |
74 | 98 |
75 func Test_bufunload() | 99 func Test_bufunload() |
76 augroup test_bufunload_group | 100 augroup test_bufunload_group |
77 autocmd! | 101 autocmd! |
78 autocmd BufUnload * call add(s:li, "bufunload") | 102 autocmd BufUnload * call add(s:li, "bufunload") |
669 | 693 |
670 " Cleanup | 694 " Cleanup |
671 au! OptionSet | 695 au! OptionSet |
672 call test_override('starting', 0) | 696 call test_override('starting', 0) |
673 "delfunc! AutoCommandOptionSet | 697 "delfunc! AutoCommandOptionSet |
674 endfunc | |
675 | |
676 func Test_OptionSet_modeline() | |
677 call test_override('starting', 1) | |
678 au! OptionSet | |
679 augroup set_tabstop | |
680 au OptionSet tabstop call timer_start(1, {-> execute("echo 'Handler called'", "")}) | |
681 augroup END | |
682 call writefile(['vim: set ts=7 sw=5 :', 'something'], 'XoptionsetModeline') | |
683 set modeline | |
684 let v:errmsg = '' | |
685 call assert_fails('split XoptionsetModeline', 'E12:') | |
686 call assert_equal(7, &ts) | |
687 call assert_equal('', v:errmsg) | |
688 | |
689 augroup set_tabstop | |
690 au! | |
691 augroup END | |
692 bwipe! | |
693 set ts& | |
694 call delete('XoptionsetModeline') | |
695 call test_override('starting', 0) | |
696 endfunc | 698 endfunc |
697 | 699 |
698 " Test for Bufleave autocommand that deletes the buffer we are about to edit. | 700 " Test for Bufleave autocommand that deletes the buffer we are about to edit. |
699 func Test_BufleaveWithDelete() | 701 func Test_BufleaveWithDelete() |
700 new | edit Xfile1 | 702 new | edit Xfile1 |