Karsten Hopp d07487
To: vim_dev@googlegroups.com
Karsten Hopp d07487
Subject: Patch 7.4.655
Karsten Hopp d07487
Fcc: outbox
Karsten Hopp d07487
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp d07487
Mime-Version: 1.0
Karsten Hopp d07487
Content-Type: text/plain; charset=UTF-8
Karsten Hopp d07487
Content-Transfer-Encoding: 8bit
Karsten Hopp d07487
------------
Karsten Hopp d07487
Karsten Hopp d07487
Patch 7.4.655
Karsten Hopp d07487
Problem:    Text deleted by "dit" depends on indent of closing tag.
Karsten Hopp d07487
	    (Jan Parthey)
Karsten Hopp d07487
Solution:   Do not adjust oap->end in do_pending_operator(). (Christian
Karsten Hopp d07487
	    Brabandt)
Karsten Hopp d07487
Files:	    src/normal.c, src/search.c, src/testdir/test53.in,
Karsten Hopp d07487
	    src/testdir/test53.ok
Karsten Hopp d07487
Karsten Hopp d07487
Karsten Hopp d07487
*** ../vim-7.4.654/src/normal.c	2015-02-27 15:03:54.368707978 +0100
Karsten Hopp d07487
--- src/normal.c	2015-03-05 19:53:49.889414297 +0100
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 9198,9203 ****
Karsten Hopp d07487
--- 9198,9211 ----
Karsten Hopp d07487
  		flag = current_block(cap->oap, cap->count1, include, '<', '>');
Karsten Hopp d07487
  		break;
Karsten Hopp d07487
  	case 't': /* "at" = a tag block (xml and html) */
Karsten Hopp d07487
+ 		/* Do not adjust oap->end in do_pending_operator()
Karsten Hopp d07487
+ 		 * otherwise there are different results for 'dit'
Karsten Hopp d07487
+ 		 * (note leading whitespace in last line):
Karsten Hopp d07487
+ 		 * 1)       2) 
Karsten Hopp d07487
+ 		 *    foobar      foobar
Karsten Hopp d07487
+ 		 *                
Karsten Hopp d07487
+ 		 */
Karsten Hopp d07487
+ 		cap->retval |= CA_NO_ADJ_OP_END;
Karsten Hopp d07487
  		flag = current_tagblock(cap->oap, cap->count1, include);
Karsten Hopp d07487
  		break;
Karsten Hopp d07487
  	case 'p': /* "ap" = a paragraph */
Karsten Hopp d07487
*** ../vim-7.4.654/src/search.c	2014-12-13 22:00:18.157279625 +0100
Karsten Hopp d07487
--- src/search.c	2015-03-05 19:55:09.112508000 +0100
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 1063,1069 ****
Karsten Hopp d07487
   * Careful: If spats[0].off.line == TRUE and spats[0].off.off == 0 this
Karsten Hopp d07487
   * makes the movement linewise without moving the match position.
Karsten Hopp d07487
   *
Karsten Hopp d07487
!  * return 0 for failure, 1 for found, 2 for found and line offset added
Karsten Hopp d07487
   */
Karsten Hopp d07487
      int
Karsten Hopp d07487
  do_search(oap, dirc, pat, count, options, tm)
Karsten Hopp d07487
--- 1063,1069 ----
Karsten Hopp d07487
   * Careful: If spats[0].off.line == TRUE and spats[0].off.off == 0 this
Karsten Hopp d07487
   * makes the movement linewise without moving the match position.
Karsten Hopp d07487
   *
Karsten Hopp d07487
!  * Return 0 for failure, 1 for found, 2 for found and line offset added.
Karsten Hopp d07487
   */
Karsten Hopp d07487
      int
Karsten Hopp d07487
  do_search(oap, dirc, pat, count, options, tm)
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 3781,3786 ****
Karsten Hopp d07487
--- 3781,3787 ----
Karsten Hopp d07487
      int		do_include = include;
Karsten Hopp d07487
      int		save_p_ws = p_ws;
Karsten Hopp d07487
      int		retval = FAIL;
Karsten Hopp d07487
+     int		is_inclusive = TRUE;
Karsten Hopp d07487
  
Karsten Hopp d07487
      p_ws = FALSE;
Karsten Hopp d07487
  
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 3895,3902 ****
Karsten Hopp d07487
      }
Karsten Hopp d07487
      else
Karsten Hopp d07487
      {
Karsten Hopp d07487
! 	/* Exclude the '<' of the end tag. */
Karsten Hopp d07487
! 	if (*ml_get_cursor() == '<')
Karsten Hopp d07487
  	    dec_cursor();
Karsten Hopp d07487
      }
Karsten Hopp d07487
      end_pos = curwin->w_cursor;
Karsten Hopp d07487
--- 3896,3910 ----
Karsten Hopp d07487
      }
Karsten Hopp d07487
      else
Karsten Hopp d07487
      {
Karsten Hopp d07487
! 	char_u *c = ml_get_cursor();
Karsten Hopp d07487
! 
Karsten Hopp d07487
! 	/* Exclude the '<' of the end tag.
Karsten Hopp d07487
! 	 * If the closing tag is on new line, do not decrement cursor, but
Karsten Hopp d07487
! 	 * make operation exclusive, so that the linefeed will be selected */
Karsten Hopp d07487
! 	if (*c == '<' && !VIsual_active && curwin->w_cursor.col == 0)
Karsten Hopp d07487
! 	    /* do not decrement cursor */
Karsten Hopp d07487
! 	    is_inclusive = FALSE;
Karsten Hopp d07487
! 	else if (*c == '<')
Karsten Hopp d07487
  	    dec_cursor();
Karsten Hopp d07487
      }
Karsten Hopp d07487
      end_pos = curwin->w_cursor;
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 3950,3956 ****
Karsten Hopp d07487
  	    oap->inclusive = FALSE;
Karsten Hopp d07487
  	}
Karsten Hopp d07487
  	else
Karsten Hopp d07487
! 	    oap->inclusive = TRUE;
Karsten Hopp d07487
      }
Karsten Hopp d07487
      retval = OK;
Karsten Hopp d07487
  
Karsten Hopp d07487
--- 3958,3964 ----
Karsten Hopp d07487
  	    oap->inclusive = FALSE;
Karsten Hopp d07487
  	}
Karsten Hopp d07487
  	else
Karsten Hopp d07487
! 	    oap->inclusive = is_inclusive;
Karsten Hopp d07487
      }
Karsten Hopp d07487
      retval = OK;
Karsten Hopp d07487
  
Karsten Hopp d07487
*** ../vim-7.4.654/src/testdir/test53.in	2014-12-13 22:00:18.157279625 +0100
Karsten Hopp d07487
--- src/testdir/test53.in	2015-03-05 19:50:34.187653489 +0100
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 23,28 ****
Karsten Hopp d07487
--- 23,29 ----
Karsten Hopp d07487
  0fXdit
Karsten Hopp d07487
  fXdat
Karsten Hopp d07487
  0fXdat
Karsten Hopp d07487
+ dit
Karsten Hopp d07487
  :"
Karsten Hopp d07487
  :put =matchstr(\"abcd\", \".\", 0, 2) " b
Karsten Hopp d07487
  :put =matchstr(\"abcd\", \"..\", 0, 2) " bc
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 97,102 ****
Karsten Hopp d07487
--- 98,106 ----
Karsten Hopp d07487
  -asdXasdfasdf-
Karsten Hopp d07487
  -asdfXasdfasdf-
Karsten Hopp d07487
  -asdXasdfasdf-
Karsten Hopp d07487
+ -
Karsten Hopp d07487
+ innertext object
Karsten Hopp d07487
+ 
Karsten Hopp d07487
  </begin>
Karsten Hopp d07487
  SEARCH:
Karsten Hopp d07487
  foobar
Karsten Hopp d07487
*** ../vim-7.4.654/src/testdir/test53.ok	2014-12-13 22:00:18.161279370 +0100
Karsten Hopp d07487
--- src/testdir/test53.ok	2015-03-05 19:50:37.903610966 +0100
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 11,16 ****
Karsten Hopp d07487
--- 11,17 ----
Karsten Hopp d07487
  --
Karsten Hopp d07487
  -asdfasdf-
Karsten Hopp d07487
  --
Karsten Hopp d07487
+ -
Karsten Hopp d07487
  </begin>
Karsten Hopp d07487
  b
Karsten Hopp d07487
  bc
Karsten Hopp d07487
*** ../vim-7.4.654/src/version.c	2015-03-05 19:35:20.690114997 +0100
Karsten Hopp d07487
--- src/version.c	2015-03-05 19:52:18.674457919 +0100
Karsten Hopp d07487
***************
Karsten Hopp d07487
*** 743,744 ****
Karsten Hopp d07487
--- 743,746 ----
Karsten Hopp d07487
  {   /* Add new patch number below this line */
Karsten Hopp d07487
+ /**/
Karsten Hopp d07487
+     655,
Karsten Hopp d07487
  /**/
Karsten Hopp d07487
Karsten Hopp d07487
-- 
Karsten Hopp d07487
CONCORDE: Message for you, sir.
Karsten Hopp d07487
   He falls forward revealing the arrow with the note.
Karsten Hopp d07487
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp d07487
Karsten Hopp d07487
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp d07487
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp d07487
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp d07487
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///