annotate src/testdir/test_exit.vim @ 15062:3a94f7918980 v8.1.0542

patch 8.1.0542: shiftwidth() does not take 'vartabstop' into account commit https://github.com/vim/vim/commit/f951416a8396a54bbbe21de1a8b16716428549f2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 22 03:08:29 2018 +0100 patch 8.1.0542: shiftwidth() does not take 'vartabstop' into account Problem: shiftwidth() does not take 'vartabstop' into account. Solution: Use the cursor position or a position explicitly passed. Also make >> and << work better with 'vartabstop'. (Christian Brabandt)
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Nov 2018 03:15:10 +0100
parents 94e638936d3e
children 9c90cf08cfa8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13442
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for exiting Vim.
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 source shared.vim
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 func Test_exiting()
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ 'help',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ 'wincmd w',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ 'split',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 \ 'new',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 \ 'qall',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 \ 'augroup nasty',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 \ ' au ExitPre * split',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 \ 'augroup END',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 \ 'augroup nasty',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 \ ' au! ExitPre',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 \ 'augroup END',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 call assert_equal(['QuitPre', 'ExitPre', 'QuitPre', 'ExitPre'],
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 \ readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 endfunc