Patch 8.2.4710

5 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 7, 2022, 4:01:30 PM4/7/22
to vim...@googlegroups.com

Patch 8.2.4710
Problem: Smart indenting does not work after completion.
Solution: Set "can_si". (Christian Brabandt, closes #10113, closes #558)
Files: src/edit.c, src/testdir/test_ins_complete.vim


*** ../vim-8.2.4709/src/edit.c 2022-04-07 15:07:42.680524339 +0100
--- src/edit.c 2022-04-07 20:57:10.275685331 +0100
***************
*** 1293,1298 ****
--- 1293,1301 ----
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
*** ../vim-8.2.4709/src/testdir/test_ins_complete.vim 2022-03-04 14:51:02.283560533 +0000
--- src/testdir/test_ins_complete.vim 2022-04-07 21:00:05.251576466 +0100
***************
*** 2132,2135 ****
--- 2132,2154 ----
%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
*** ../vim-8.2.4709/src/version.c 2022-04-07 18:06:03.346408470 +0100
--- src/version.c 2022-04-07 20:58:40.455632730 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4710,
/**/

--
Every time I lose weight, it finds me again!

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages