From 01b8240b60c7b36546c99e9467d92e7dd931989c Mon Sep 17 00:00:00 2001 From: Jason Downs Date: Tue, 24 Sep 1996 17:53:50 +0000 Subject: Movement bug fix from mool, via vimdev. --- usr.bin/vim/cmdcmds.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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; } -- cgit v1.2.3