summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-09-24 17:53:50 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-09-24 17:53:50 +0000
commit01b8240b60c7b36546c99e9467d92e7dd931989c (patch)
tree2b87228429988dcbc787560651e4fc32c7071dec /usr.bin
parentdbf827fa085d459d91ee2e6ba6e64db043c71982 (diff)
Movement bug fix from mool, via vimdev.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vim/cmdcmds.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/vim/cmdcmds.c b/usr.bin/vim/cmdcmds.c
index b4018aea983..6401177cf62 100644
--- a/usr.bin/vim/cmdcmds.c
+++ b/usr.bin/vim/cmdcmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmdcmds.c,v 1.3 1996/09/22 01:17:58 downsj Exp $ */
+/* $OpenBSD: cmdcmds.c,v 1.4 1996/09/24 17:53:49 downsj Exp $ */
/* vi:set ts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
@@ -341,6 +341,15 @@ do_move(line1, line2, n)
CHANGED;
if (!global_busy && num_lines > p_report)
smsg((char_u *)"%ld line%s moved", num_lines, plural(num_lines));
+
+ /*
+ * Leave the cursor on the last of the moved lines.
+ */
+ if (n >= line1)
+ curwin->w_cursor.lnum = n;
+ else
+ curwin->w_cursor.lnum = n + (line2 - line1) + 1;
+
return OK;
}