Karsten Hopp 9716d7
To: vim_dev@googlegroups.com
Karsten Hopp 9716d7
Subject: Patch 7.3.858
Karsten Hopp 9716d7
Fcc: outbox
Karsten Hopp 9716d7
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 9716d7
Mime-Version: 1.0
Karsten Hopp 9716d7
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 9716d7
Content-Transfer-Encoding: 8bit
Karsten Hopp 9716d7
------------
Karsten Hopp 9716d7
Karsten Hopp 9716d7
Patch 7.3.858
Karsten Hopp 9716d7
Problem:    "gv" selects the wrong area after some operators.
Karsten Hopp 9716d7
Solution:   Save and restore the type of selection. (Christian Brabandt)
Karsten Hopp 9716d7
Files:	    src/testdir/test66.in, src/testdir/test66.ok, src/normal.c
Karsten Hopp 9716d7
Karsten Hopp 9716d7
Karsten Hopp 9716d7
*** ../vim-7.3.857/src/testdir/test66.in	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 9716d7
--- src/testdir/test66.in	2013-03-13 18:42:46.000000000 +0100
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 3,14 ****
Karsten Hopp 9716d7
  
Karsten Hopp 9716d7
  STARTTEST
Karsten Hopp 9716d7
  :so small.vim
Karsten Hopp 9716d7
  /^abcdefgh
Karsten Hopp 9716d7
  ?4jI    ?j<<11|D
Karsten Hopp 9716d7
  7|a		?
Karsten Hopp 9716d7
  7|a		   ?
Karsten Hopp 9716d7
  7|a	       	?4k13|?4j<
Karsten Hopp 9716d7
! :$-4,$w! test.out
Karsten Hopp 9716d7
  :$-4,$s/\s\+//g
Karsten Hopp 9716d7
  ?4kI    ?j<<
Karsten Hopp 9716d7
  7|a		?
Karsten Hopp 9716d7
--- 3,16 ----
Karsten Hopp 9716d7
  
Karsten Hopp 9716d7
  STARTTEST
Karsten Hopp 9716d7
  :so small.vim
Karsten Hopp 9716d7
+ /^one
Karsten Hopp 9716d7
+ fe?4jR?ugvr1:'<,'>w! test.out
Karsten Hopp 9716d7
  /^abcdefgh
Karsten Hopp 9716d7
  ?4jI    ?j<<11|D
Karsten Hopp 9716d7
  7|a		?
Karsten Hopp 9716d7
  7|a		   ?
Karsten Hopp 9716d7
  7|a	       	?4k13|?4j<
Karsten Hopp 9716d7
! :$-5,$w >> test.out
Karsten Hopp 9716d7
  :$-4,$s/\s\+//g
Karsten Hopp 9716d7
  ?4kI    ?j<<
Karsten Hopp 9716d7
  7|a		?
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 18,23 ****
Karsten Hopp 9716d7
--- 20,31 ----
Karsten Hopp 9716d7
  :qa!
Karsten Hopp 9716d7
  ENDTEST
Karsten Hopp 9716d7
  
Karsten Hopp 9716d7
+ one two three
Karsten Hopp 9716d7
+ one two three
Karsten Hopp 9716d7
+ one two three
Karsten Hopp 9716d7
+ one two three
Karsten Hopp 9716d7
+ one two three
Karsten Hopp 9716d7
+ 
Karsten Hopp 9716d7
  abcdefghijklmnopqrstuvwxyz
Karsten Hopp 9716d7
  abcdefghijklmnopqrstuvwxyz
Karsten Hopp 9716d7
  abcdefghijklmnopqrstuvwxyz
Karsten Hopp 9716d7
*** ../vim-7.3.857/src/testdir/test66.ok	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 9716d7
--- src/testdir/test66.ok	2013-03-13 18:42:46.000000000 +0100
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 1,3 ****
Karsten Hopp 9716d7
--- 1,9 ----
Karsten Hopp 9716d7
+ on1 two three
Karsten Hopp 9716d7
+ on1 two three
Karsten Hopp 9716d7
+ on1 two three
Karsten Hopp 9716d7
+ on1 two three
Karsten Hopp 9716d7
+ on1 two three
Karsten Hopp 9716d7
+ 
Karsten Hopp 9716d7
      abcdefghijklmnopqrstuvwxyz
Karsten Hopp 9716d7
  abcdefghij
Karsten Hopp 9716d7
      abc	    defghijklmnopqrstuvwxyz
Karsten Hopp 9716d7
*** ../vim-7.3.857/src/normal.c	2013-02-26 13:30:28.000000000 +0100
Karsten Hopp 9716d7
--- src/normal.c	2013-03-13 18:47:49.000000000 +0100
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 21,26 ****
Karsten Hopp 9716d7
--- 21,27 ----
Karsten Hopp 9716d7
  static int	resel_VIsual_mode = NUL;	/* 'v', 'V', or Ctrl-V */
Karsten Hopp 9716d7
  static linenr_T	resel_VIsual_line_count;	/* number of lines */
Karsten Hopp 9716d7
  static colnr_T	resel_VIsual_vcol;		/* nr of cols or end col */
Karsten Hopp 9716d7
+ static int	VIsual_mode_orig = NUL;         /* type of Visual mode, that user entered */
Karsten Hopp 9716d7
  
Karsten Hopp 9716d7
  static int	restart_VIsual_select = 0;
Karsten Hopp 9716d7
  #endif
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 1594,1599 ****
Karsten Hopp 9716d7
--- 1595,1605 ----
Karsten Hopp 9716d7
  		curbuf->b_visual.vi_start = VIsual;
Karsten Hopp 9716d7
  		curbuf->b_visual.vi_end = curwin->w_cursor;
Karsten Hopp 9716d7
  		curbuf->b_visual.vi_mode = VIsual_mode;
Karsten Hopp 9716d7
+ 		if (VIsual_mode_orig != NUL)
Karsten Hopp 9716d7
+ 		{
Karsten Hopp 9716d7
+ 		    curbuf->b_visual.vi_mode = VIsual_mode_orig;
Karsten Hopp 9716d7
+ 		    VIsual_mode_orig = NUL;
Karsten Hopp 9716d7
+ 		}
Karsten Hopp 9716d7
  		curbuf->b_visual.vi_curswant = curwin->w_curswant;
Karsten Hopp 9716d7
  # ifdef FEAT_EVAL
Karsten Hopp 9716d7
  		curbuf->b_visual_mode_eval = VIsual_mode;
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 7230,7235 ****
Karsten Hopp 9716d7
--- 7236,7242 ----
Karsten Hopp 9716d7
      {
Karsten Hopp 9716d7
  	cap->cmdchar = 'c';
Karsten Hopp 9716d7
  	cap->nchar = NUL;
Karsten Hopp 9716d7
+ 	VIsual_mode_orig = VIsual_mode; /* remember original area for gv */
Karsten Hopp 9716d7
  	VIsual_mode = 'V';
Karsten Hopp 9716d7
  	nv_operator(cap);
Karsten Hopp 9716d7
      }
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 7429,7435 ****
Karsten Hopp 9716d7
--- 7436,7445 ----
Karsten Hopp 9716d7
      if (isupper(cap->cmdchar))
Karsten Hopp 9716d7
      {
Karsten Hopp 9716d7
  	if (VIsual_mode != Ctrl_V)
Karsten Hopp 9716d7
+ 	{
Karsten Hopp 9716d7
+ 	    VIsual_mode_orig = VIsual_mode;
Karsten Hopp 9716d7
  	    VIsual_mode = 'V';
Karsten Hopp 9716d7
+ 	}
Karsten Hopp 9716d7
  	else if (cap->cmdchar == 'C' || cap->cmdchar == 'D')
Karsten Hopp 9716d7
  	    curwin->w_curswant = MAXCOL;
Karsten Hopp 9716d7
      }
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 7449,7455 ****
Karsten Hopp 9716d7
--- 7459,7468 ----
Karsten Hopp 9716d7
      if (VIsual_active)	/* "vs" and "vS" are the same as "vc" */
Karsten Hopp 9716d7
      {
Karsten Hopp 9716d7
  	if (cap->cmdchar == 'S')
Karsten Hopp 9716d7
+ 	{
Karsten Hopp 9716d7
+ 	    VIsual_mode_orig = VIsual_mode;
Karsten Hopp 9716d7
  	    VIsual_mode = 'V';
Karsten Hopp 9716d7
+ 	}
Karsten Hopp 9716d7
  	cap->cmdchar = 'c';
Karsten Hopp 9716d7
  	nv_operator(cap);
Karsten Hopp 9716d7
      }
Karsten Hopp 9716d7
*** ../vim-7.3.857/src/version.c	2013-03-13 18:30:39.000000000 +0100
Karsten Hopp 9716d7
--- src/version.c	2013-03-13 18:48:50.000000000 +0100
Karsten Hopp 9716d7
***************
Karsten Hopp 9716d7
*** 730,731 ****
Karsten Hopp 9716d7
--- 730,733 ----
Karsten Hopp 9716d7
  {   /* Add new patch number below this line */
Karsten Hopp 9716d7
+ /**/
Karsten Hopp 9716d7
+     858,
Karsten Hopp 9716d7
  /**/
Karsten Hopp 9716d7
Karsten Hopp 9716d7
-- 
Karsten Hopp 9716d7
"Oh, no!  NOT the Spanish Inquisition!"
Karsten Hopp 9716d7
"NOBODY expects the Spanish Inquisition!!!"
Karsten Hopp 9716d7
				-- Monty Python sketch --
Karsten Hopp 9716d7
"Oh, no!  NOT another option!"
Karsten Hopp 9716d7
"EVERYBODY expects another option!!!"
Karsten Hopp 9716d7
				-- Discussion in vim-dev mailing list --
Karsten Hopp 9716d7
Karsten Hopp 9716d7
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 9716d7
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 9716d7
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 9716d7
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///