summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-05 21:29:01 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-05 21:29:01 +0200
commit8d3b51084a5bdcd2ee9e31bc03cba0d16c43d428 (patch)
tree9d639842238d3d284834750ef03b4bc6e550903e /src/ex_docmd.c
parenta0d1fef4ebb693696464c5e22e33269f724b8e0e (diff)
patch 8.1.1988: :startinsert! does not work the same way as "A"v8.1.1988
Problem: :startinsert! does not work the same way as "A". Solution: Use the same code to move the cursor. (closes #4896)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index ef86ae5fc5..0e0e1b8794 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7596,16 +7596,14 @@ ex_startinsert(exarg_T *eap)
{
if (eap->forceit)
{
- /* cursor line can be zero on startup */
+ // cursor line can be zero on startup
if (!curwin->w_cursor.lnum)
curwin->w_cursor.lnum = 1;
- coladvance((colnr_T)MAXCOL);
- curwin->w_curswant = MAXCOL;
- curwin->w_set_curswant = FALSE;
+ set_cursor_for_append_to_line();
}
- /* Ignore the command when already in Insert mode. Inserting an
- * expression register that invokes a function can do this. */
+ // Ignore the command when already in Insert mode. Inserting an
+ // expression register that invokes a function can do this.
if (State & INSERT)
return;
@@ -7620,7 +7618,7 @@ ex_startinsert(exarg_T *eap)
{
if (eap->cmdidx == CMD_startinsert)
restart_edit = 'i';
- curwin->w_curswant = 0; /* avoid MAXCOL */
+ curwin->w_curswant = 0; // avoid MAXCOL
}
}