summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/normal.c10
-rw-r--r--src/spell.c2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c
index 3a336d5e18..57591f7ed3 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -8993,7 +8993,17 @@ nv_put(cap)
/* When all lines were selected and deleted do_put() leaves an empty
* line that needs to be deleted now. */
if (empty && *ml_get(curbuf->b_ml.ml_line_count) == NUL)
+ {
ml_delete(curbuf->b_ml.ml_line_count, TRUE);
+
+ /* If the cursor was in that line, move it to the end of the last
+ * line. */
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ {
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ coladvance((colnr_T)MAXCOL);
+ }
+ }
#endif
auto_format(FALSE, TRUE);
}
diff --git a/src/spell.c b/src/spell.c
index 32ce2b49d2..9850777531 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -2039,7 +2039,7 @@ spell_move_to(wp, dir, allwords, curline, attrp)
/*
* Start looking for bad word at the start of the line, because we can't
- * start halfway a word, we don't know where the it starts or ends.
+ * start halfway a word, we don't know where it starts or ends.
*
* When searching backwards, we continue in the line to find the last
* bad word (in the cursor line: before the cursor).