patch 8.1.1988: :startinsert! does not work the same way as "A"
Problem: :startinsert! does not work the same way as "A".
Solution: Use the same code to move the cursor. (closes #4896)
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index 799642d..6ee5848 100644
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -1480,3 +1480,18 @@
close!
endfunc
+
+func Test_edit_startinsert()
+ new
+ set backspace+=start
+ call setline(1, 'foobar')
+ call feedkeys("A\<C-U>\<Esc>", 'xt')
+ call assert_equal('', getline(1))
+
+ call setline(1, 'foobar')
+ call feedkeys(":startinsert!\<CR>\<C-U>\<Esc>", 'xt')
+ call assert_equal('', getline(1))
+
+ set backspace&
+ bwipe!
+endfunc