annotate src/testdir/test_smartindent.vim @ 15024:3a3c9b638187 v8.1.0523

patch 8.1.0523: opening window from quickfix leaves empty buffer behind commit https://github.com/vim/vim/commit/b244373becbec124bee20dbbfd05365586cda8cd Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 11 22:50:27 2018 +0100 patch 8.1.0523: opening window from quickfix leaves empty buffer behind Problem: Opening window from quickfix leaves empty buffer behind. Solution: Add qf_jump_newwin(). (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/2574)
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Nov 2018 23:00:05 +0100
parents 268b1036cd17
children 63b02fcf1361
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11943
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
1 " Tests for smartindent
10145
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Tests for not doing smart indenting when it isn't set.
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 function! Test_nosmartindent()
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 new
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 call append(0, [" some test text",
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 \ " test text",
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 \ "test text",
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 \ " test text"])
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 set nocindent nosmartindent autoindent
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 exe "normal! gg/some\<CR>"
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 exe "normal! 2cc#test\<Esc>"
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 call assert_equal(" #test", getline(1))
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 enew! | close
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 endfunction
11943
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
16
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
17 function MyIndent()
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
18 endfunction
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
19
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
20 " When 'indentexpr' is set, setting 'si' has no effect.
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
21 function Test_smartindent_has_no_effect()
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
22 new
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
23 exe "normal! i\<Tab>one\<Esc>"
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
24 set noautoindent
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
25 set smartindent
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
26 set indentexpr=
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
27 exe "normal! Gotwo\<Esc>"
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
28 call assert_equal("\ttwo", getline("$"))
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
29
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
30 set indentexpr=MyIndent
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
31 exe "normal! Gothree\<Esc>"
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
32 call assert_equal("three", getline("$"))
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
33
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
34 delfunction! MyIndent
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
35 set autoindent&
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
36 set smartindent&
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
37 set indentexpr&
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
38 bwipe!
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
39 endfunction
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
40
268b1036cd17 patch 8.0.0851: 'smartindent' is used even when 'indentexpr' is set
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
41 " vim: shiftwidth=2 sts=2 expandtab