forked from aniani/vim
patch 8.2.4951: smart indenting done when not enabled
Problem: Smart indenting done when not enabled. Solution: Check option values before setting can_si. (closes #10420)
This commit is contained in:
@@ -134,4 +134,21 @@ func Test_si_with_paste()
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_si_after_completion()
|
||||
new
|
||||
setlocal ai smartindent indentexpr=
|
||||
call setline(1, 'foo foot')
|
||||
call feedkeys("o f\<C-X>\<C-N>#", 'tx')
|
||||
call assert_equal(' foo#', getline(2))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_no_si_after_completion()
|
||||
new
|
||||
call setline(1, 'foo foot')
|
||||
call feedkeys("o f\<C-X>\<C-N>#", 'tx')
|
||||
call assert_equal(' foo#', getline(2))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user