Problem: Blockwise insert does not handle autoindent properly.
Solution: Adjust text column for indent. (closes #9229)
--bd2.textlen;
}
bd.textcol = bd2.textcol;
+ if (did_indent && bd.textcol > ind_pre)
+ // If the insert was in the indent then include the indent
+ // change in the new text, otherwise don't.
+ bd.textcol += ind_post - ind_pre;
bd.textlen = bd2.textlen;
}
bwipe!
endfunc
+func Test_blockinsert_autoindent()
+ new
+ let lines =<< trim END
+ var d = {
+ a: () => 0,
+ b: () => 0,
+ c: () => 0,
+ }
+ END
+ call setline(1, lines)
+ filetype plugin indent on
+ setlocal sw=2 et ft=vim
+ setlocal indentkeys+=:
+ exe "norm! 2Gf)\<c-v>2jA: asdf\<esc>"
+ let expected =<< trim END
+ var d = {
+ a: (): asdf => 0,
+ b: (): asdf => 0,
+ c: (): asdf => 0,
+ }
+ END
+ call assert_equal(expected, getline(1, 5))
+
+ filetype off
+ bwipe!
+endfunc
+
func Test_blockinsert_delete()
new
let _bs = &bs
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3684,
/**/
3683,
/**/