comparison src/testdir/test_ins_complete.vim @ 28369:38332c6da029 v8.2.4710

patch 8.2.4710: smart indenting does not work after completion Commit: https://github.com/vim/vim/commit/ac72c21da696cf6c31630a9e5ff4c0d3e2049c11 Author: Christian Brabandt <cb@256bit.org> Date: Thu Apr 7 21:00:53 2022 +0100 patch 8.2.4710: smart indenting does not work after completion Problem: Smart indenting does not work after completion. Solution: Set "can_si". (Christian Brabandt, closes https://github.com/vim/vim/issues/10113, closes https://github.com/vim/vim/issues/558)
author Bram Moolenaar <Bram@vim.org>
date Thu, 07 Apr 2022 22:15:03 +0200
parents 3de9be15de51
children c1591fa6f81a
comparison
equal deleted inserted replaced
28368:04fcfcacf321 28369:38332c6da029
2130 delfunc TsrFunc2 2130 delfunc TsrFunc2
2131 unlet g:TsrFunc1Args g:TsrFunc2Args 2131 unlet g:TsrFunc1Args g:TsrFunc2Args
2132 %bw! 2132 %bw!
2133 endfunc 2133 endfunc
2134 2134
2135 func FooBarComplete(findstart, base)
2136 if a:findstart
2137 return col('.') - 1
2138 else
2139 return ["Foo", "Bar", "}"]
2140 endif
2141 endfunc
2142
2143 func Test_complete_smartindent()
2144 new
2145 setlocal smartindent completefunc=FooBarComplete
2146
2147 exe "norm! o{\<cr>\<c-x>\<c-u>\<c-p>}\<cr>\<esc>"
2148 let result = getline(1,'$')
2149 call assert_equal(['', '{','}',''], result)
2150 bw!
2151 delfunction! FooBarComplete
2152 endfunc
2153
2135 " vim: shiftwidth=2 sts=2 expandtab 2154 " vim: shiftwidth=2 sts=2 expandtab