0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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 #10113, closes #558)
This commit is contained in:
Christian Brabandt
2022-04-07 21:00:53 +01:00
committed by Bram Moolenaar
parent 5017c66bd4
commit ac72c21da6
3 changed files with 24 additions and 0 deletions

View File

@@ -1293,6 +1293,9 @@ docomplete:
disable_fold_update--;
#endif
compl_busy = FALSE;
#ifdef FEAT_SMARTINDENT
can_si = TRUE; // allow smartindenting
#endif
break;
case Ctrl_Y: // copy from previous line or scroll down

View File

@@ -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

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4710,
/**/
4709,
/**/