summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-26 17:40:45 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-26 17:40:45 +0200
commit09ca932f8e7d63a83b39baa7c03d4c6145e3baab (patch)
tree56da738a73422e376a8eed5779bab6e620498c08 /src/ex_docmd.c
parent6edeaf387c7218a84a5521a4e82b4000496b523b (diff)
downloadvim-git-09ca932f8e7d63a83b39baa7c03d4c6145e3baab.tar.gz
patch 8.0.1151: "vim -c startinsert!" doesn't appendv8.0.1151
Problem: "vim -c startinsert!" doesn't append. Solution: Correct line number on startup. (Christian Brabandt, closes #2117)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index c740d037f..e2dfd9225 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -10294,6 +10294,9 @@ ex_startinsert(exarg_T *eap)
{
if (eap->forceit)
{
+ /* 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;