Bram,
when visual mode is active and one is jumping to another position
using :<nr> visual mode is unexpectedly ended.

Attached patch fixes this issue.

regards,
Christian
-- 
Oft besteht die größ(ere) Kraft eines Mannes weniger darin, wie er ein
Amt verwaltet, als wie [er] in dasselbe gelangte.
                -- Jean Paul

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php



diff -r 503d7624212a src/ex_docmd.c
--- a/src/ex_docmd.c	Sat Jan 26 14:09:37 2013 +0100
+++ b/src/ex_docmd.c	Sat Jan 26 15:14:43 2013 +0100
@@ -1721,6 +1721,7 @@
 #endif
     cmdmod_T		save_cmdmod;
     int			ni;			/* set when Not Implemented */
+    int			restart_visual = FALSE; /* True, if to restore visual mode */
 
     vim_memset(&ea, 0, sizeof(ea));
     ea.line1 = 1;
@@ -1750,6 +1751,15 @@
     /* "#!anything" is handled like a comment. */
     if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!')
 	goto doend;
+#ifdef FEAT_VISUAL
+    if ((*cmdlinep)[0] == '\'' &&
+	(*cmdlinep)[1] == '<' &&
+	(*cmdlinep)[2] == ',' &&
+	(*cmdlinep)[3] == '\'' &&
+	(*cmdlinep)[4] == '>')
+	restart_visual = TRUE;
+#endif
+
 
     /*
      * Repeat until no more command modifiers are found.
@@ -2118,6 +2128,14 @@
 		    curwin->w_cursor.lnum = 1;
 		else
 		    curwin->w_cursor.lnum = ea.line2;
+#ifdef FEAT_VISUAL
+		if (restart_visual)
+		{
+		    VIsual_active = TRUE;
+		    /* ea.addr_count has been added to ea.line2 */
+		    curwin->w_cursor.lnum--;
+		}
+#endif
 		beginline(BL_SOL | BL_FIX);
 	    }
 	}

Raspunde prin e-mail lui