mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
vim-patch:8.2.4710: smart indenting does not work after completion (#18030)
Problem: Smart indenting does not work after completion.
Solution: Set "can_si". (Christian Brabandt, closes vim/vim#10113, closes vim/vim#558)
ac72c21da6
This commit is contained in:
parent
8c25dbff46
commit
65a5cea0d3
@ -1393,6 +1393,7 @@ static void insert_do_complete(InsertState *s)
|
||||
compl_cont_status = 0;
|
||||
}
|
||||
compl_busy = false;
|
||||
can_si = true; // allow smartindenting
|
||||
}
|
||||
|
||||
static void insert_do_cindent(InsertState *s)
|
||||
|
@ -707,4 +707,23 @@ func Test_z1_complete_no_history()
|
||||
close!
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user