comparison src/testdir/test_smartindent.vim @ 19603:6d3c683466f4 v8.2.0358

patch 8.2.0358: insufficient testing for indent.c Commit: https://github.com/vim/vim/commit/bd7206e02c957f0619e68e1628e2a3e91dd41e06 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 6 20:36:04 2020 +0100 patch 8.2.0358: insufficient testing for indent.c Problem: Insufficient testing for indent.c. Solution: Add indent tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5736)
author Bram Moolenaar <Bram@vim.org>
date Fri, 06 Mar 2020 20:45:04 +0100
parents 63b02fcf1361
children 12518b40c161
comparison
equal deleted inserted replaced
19602:03c12433ae36 19603:6d3c683466f4
36 set smartindent& 36 set smartindent&
37 set indentexpr& 37 set indentexpr&
38 bwipe! 38 bwipe!
39 endfunc 39 endfunc
40 40
41 " Test for inserting '{' and '} with smartindent
42 func Test_smartindent_braces()
43 new
44 set smartindent shiftwidth=4
45 call setline(1, [' if (a)', "\tif (b)", "\t return 1"])
46 normal 2ggO{
47 normal 3ggA {
48 normal 4ggo}
49 normal o}
50 normal 4ggO#define FOO 1
51 call assert_equal([
52 \ ' if (a)',
53 \ ' {',
54 \ "\tif (b) {",
55 \ '#define FOO 1',
56 \ "\t return 1",
57 \ "\t}",
58 \ ' }'
59 \ ], getline(1, '$'))
60 set si& sw& ai&
61 close!
62 endfunc
63
41 " vim: shiftwidth=2 sts=2 expandtab 64 " vim: shiftwidth=2 sts=2 expandtab