diff options
author | Christian Brabandt <cb@256bit.org> | 2022-04-07 21:00:53 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-07 21:00:53 +0100 |
commit | ac72c21da696cf6c31630a9e5ff4c0d3e2049c11 (patch) | |
tree | 77e3a365158f60d4764db59d54ca20d42a07d922 /src/testdir/test_ins_complete.vim | |
parent | 5017c66bd461eab46094e076ad1aa818e246ce9d (diff) |
patch 8.2.4710: smart indenting does not work after completionv8.2.4710
Problem: Smart indenting does not work after completion.
Solution: Set "can_si". (Christian Brabandt, closes #10113, closes #558)
Diffstat (limited to 'src/testdir/test_ins_complete.vim')
-rw-r--r-- | src/testdir/test_ins_complete.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 3712abe690..75ec03cb37 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -2132,4 +2132,23 @@ func Test_thesaurusfunc_callback() %bw! endfunc +func FooBarComplete(findstart, base) + if a:findstart + return col('.') - 1 + else + return ["Foo", "Bar", "}"] + endif +endfunc + +func Test_complete_smartindent() + new + setlocal smartindent completefunc=FooBarComplete + + exe "norm! o{\<cr>\<c-x>\<c-u>\<c-p>}\<cr>\<esc>" + let result = getline(1,'$') + call assert_equal(['', '{','}',''], result) + bw! + delfunction! FooBarComplete +endfunc + " vim: shiftwidth=2 sts=2 expandtab |