Karsten Hopp 76bbfe
To: vim_dev@googlegroups.com
Karsten Hopp 76bbfe
Subject: Patch 7.3.318
Karsten Hopp 76bbfe
Fcc: outbox
Karsten Hopp 76bbfe
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 76bbfe
Mime-Version: 1.0
Karsten Hopp 76bbfe
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 76bbfe
Content-Transfer-Encoding: 8bit
Karsten Hopp 76bbfe
------------
Karsten Hopp 76bbfe
Karsten Hopp 76bbfe
Patch 7.3.318
Karsten Hopp 76bbfe
Problem:    "C" on the last line deletes that line if it's blank.
Karsten Hopp 76bbfe
Solution:   Only delete the last line for a delete operation. (James Vega)
Karsten Hopp 76bbfe
Files:	    src/ops.c
Karsten Hopp 76bbfe
Karsten Hopp 76bbfe
Karsten Hopp 76bbfe
*** ../vim-7.3.317/src/ops.c	2011-08-10 12:10:55.000000000 +0200
Karsten Hopp 76bbfe
--- src/ops.c	2011-09-21 17:32:36.000000000 +0200
Karsten Hopp 76bbfe
***************
Karsten Hopp 76bbfe
*** 1922,1928 ****
Karsten Hopp 76bbfe
  		    curwin->w_cursor.coladd = 0;
Karsten Hopp 76bbfe
  	    }
Karsten Hopp 76bbfe
  #endif
Karsten Hopp 76bbfe
! 	    if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count
Karsten Hopp 76bbfe
  		    && n > (int)STRLEN(ml_get(oap->end.lnum)))
Karsten Hopp 76bbfe
  	    {
Karsten Hopp 76bbfe
  		/* Special case: gH deletes the last line. */
Karsten Hopp 76bbfe
--- 1922,1930 ----
Karsten Hopp 76bbfe
  		    curwin->w_cursor.coladd = 0;
Karsten Hopp 76bbfe
  	    }
Karsten Hopp 76bbfe
  #endif
Karsten Hopp 76bbfe
! 	    if (oap->op_type == OP_DELETE
Karsten Hopp 76bbfe
! 		    && oap->inclusive
Karsten Hopp 76bbfe
! 		    && oap->end.lnum == curbuf->b_ml.ml_line_count
Karsten Hopp 76bbfe
  		    && n > (int)STRLEN(ml_get(oap->end.lnum)))
Karsten Hopp 76bbfe
  	    {
Karsten Hopp 76bbfe
  		/* Special case: gH deletes the last line. */
Karsten Hopp 76bbfe
***************
Karsten Hopp 76bbfe
*** 3331,3338 ****
Karsten Hopp 76bbfe
  	if (regname == '=')
Karsten Hopp 76bbfe
  	{
Karsten Hopp 76bbfe
  	    /* For the = register we need to split the string at NL
Karsten Hopp 76bbfe
! 	     * characters. */
Karsten Hopp 76bbfe
! 	    /* Loop twice: count the number of lines and save them. */
Karsten Hopp 76bbfe
  	    for (;;)
Karsten Hopp 76bbfe
  	    {
Karsten Hopp 76bbfe
  		y_size = 0;
Karsten Hopp 76bbfe
--- 3333,3340 ----
Karsten Hopp 76bbfe
  	if (regname == '=')
Karsten Hopp 76bbfe
  	{
Karsten Hopp 76bbfe
  	    /* For the = register we need to split the string at NL
Karsten Hopp 76bbfe
! 	     * characters.
Karsten Hopp 76bbfe
! 	     * Loop twice: count the number of lines and save them. */
Karsten Hopp 76bbfe
  	    for (;;)
Karsten Hopp 76bbfe
  	    {
Karsten Hopp 76bbfe
  		y_size = 0;
Karsten Hopp 76bbfe
***************
Karsten Hopp 76bbfe
*** 3348,3354 ****
Karsten Hopp 76bbfe
  			if (y_array != NULL)
Karsten Hopp 76bbfe
  			    *ptr = NUL;
Karsten Hopp 76bbfe
  			++ptr;
Karsten Hopp 76bbfe
! 			/* A trailing '\n' makes the string linewise */
Karsten Hopp 76bbfe
  			if (*ptr == NUL)
Karsten Hopp 76bbfe
  			{
Karsten Hopp 76bbfe
  			    y_type = MLINE;
Karsten Hopp 76bbfe
--- 3350,3356 ----
Karsten Hopp 76bbfe
  			if (y_array != NULL)
Karsten Hopp 76bbfe
  			    *ptr = NUL;
Karsten Hopp 76bbfe
  			++ptr;
Karsten Hopp 76bbfe
! 			/* A trailing '\n' makes the register linewise. */
Karsten Hopp 76bbfe
  			if (*ptr == NUL)
Karsten Hopp 76bbfe
  			{
Karsten Hopp 76bbfe
  			    y_type = MLINE;
Karsten Hopp 76bbfe
*** ../vim-7.3.317/src/version.c	2011-09-21 17:15:34.000000000 +0200
Karsten Hopp 76bbfe
--- src/version.c	2011-09-21 17:31:48.000000000 +0200
Karsten Hopp 76bbfe
***************
Karsten Hopp 76bbfe
*** 711,712 ****
Karsten Hopp 76bbfe
--- 711,714 ----
Karsten Hopp 76bbfe
  {   /* Add new patch number below this line */
Karsten Hopp 76bbfe
+ /**/
Karsten Hopp 76bbfe
+     318,
Karsten Hopp 76bbfe
  /**/
Karsten Hopp 76bbfe
Karsten Hopp 76bbfe
-- 
Karsten Hopp 76bbfe
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 76bbfe
26. You check your mail. It says "no new messages." So you check it again.
Karsten Hopp 76bbfe
Karsten Hopp 76bbfe
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 76bbfe
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 76bbfe
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 76bbfe
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///