annotate src/testdir/test_tab.vim @ 12798:5ae0d05e046a v8.0.1276

patch 8.0.1276: key lost when window closed in exit callback commit https://github.com/vim/vim/commit/a3f7e58bf846b28b347a5d5b96c2d829871bd212 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 9 13:21:58 2017 +0100 patch 8.0.1276: key lost when window closed in exit callback Problem: Typed key is lost when the terminal window is closed in exit callback. (Gabriel Barta) Solution: When the current window changes bail out of the wait loop. (closes #2302)
author Christian Brabandt <cb@256bit.org>
date Thu, 09 Nov 2017 13:30:05 +0100
parents aa658b33f25a
children fbf0681606fa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12686
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Also test that dv_ works correctly
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 func Test_smarttab()
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 set smarttab expandtab ts=8 sw=4
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " make sure that backspace works, no matter what termcap is used
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 exe "set t_kD=\<C-V>x7f t_kb=\<C-V>x08"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 call append(0, ['start text',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 \ "\t\tsome test text",
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 \ 'test text',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 \ "\t\tother test text",
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 \ ' a cde',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 \ ' f ghi',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 \ 'test text',
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 \ ' Second line beginning with whitespace'
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ ])
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call cursor(1, 1)
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 exe "normal /some\<CR>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 exe "normal r\t"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call assert_equal("\t\t ome test text", getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 set noexpandtab
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 exe "normal /other\<CR>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 exe "normal r\t"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call assert_equal("\t\t ther test text", getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 " Test replacing with Tabs and then backspacing to undo it
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 exe "normal j0wR\t\t\t\<BS>\<BS>\<BS>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 call assert_equal(" a cde", getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 " Test replacing with Tabs
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 exe "normal j0wR\t\t\t"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 call assert_equal(" \t\thi", getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 " Test that copyindent works with expandtab set
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 set expandtab smartindent copyindent ts=8 sw=8 sts=8
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 exe "normal jo{\<CR>x"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 call assert_equal('{', getline(line('.') - 1))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call assert_equal(' x', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 set nosol
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 exe "normal /Second line/\<CR>"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 exe "normal fwdv_"
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 call assert_equal(' with whitespace', getline('.'))
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 enew!
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 set expandtab& smartindent& copyindent& ts& sw& sts&
aa658b33f25a patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 endfunc