To: vim-dev@vim.org
Subject: Patch 6.0.148
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.0.148
Problem:    After "p" in an empty line, `[ goes to the second character.
	    (Kontra Gergely)
Solution:   Don't increment the column number in an empty line.
Files:	    src/ops.c


*** ../vim60.147/src/ops.c	Tue Nov  6 15:54:13 2001
--- src/ops.c	Tue Jan 22 16:36:28 2002
***************
*** 2809,2828 ****
  	orig_indent = get_indent();
  
      curbuf->b_op_start = curwin->w_cursor;	/* default for '[ mark */
-     if (dir == FORWARD)
-     {
- 	/* move to the start of the next (multi-byte) character */
- #ifdef FEAT_MBYTE
- 	if (has_mbyte)
- 	{
- 	    bytelen = (*mb_ptr2len_check)(ml_get_cursor());
- 	    curbuf->b_op_start.col += bytelen;
- 	}
- 	else
- #endif
- 	    curbuf->b_op_start.col++;
-     }
- 
      curbuf->b_op_end = curwin->w_cursor;	/* default for '] mark */
  
      /*
--- 2809,2814 ----
***************
*** 2834,2840 ****
  	(void)stuff_inserted((dir == FORWARD ? (count == -1 ? 'o' : 'a') :
  				    (count == -1 ? 'O' : 'i')), count, FALSE);
  	/* Putting the text is done later, so can't really move the cursor to
! 	 * the nex character.  Use "l" to simulate it. */
  	if ((flags & PUT_CURSEND) && gchar_cursor() != NUL)
  	    stuffcharReadbuff('l');
  	return;
--- 2820,2826 ----
  	(void)stuff_inserted((dir == FORWARD ? (count == -1 ? 'o' : 'a') :
  				    (count == -1 ? 'O' : 'i')), count, FALSE);
  	/* Putting the text is done later, so can't really move the cursor to
! 	 * the next character.  Use "l" to simulate it. */
  	if ((flags & PUT_CURSEND) && gchar_cursor() != NUL)
  	    stuffcharReadbuff('l');
  	return;
***************
*** 3130,3135 ****
--- 3116,3125 ----
  
  	changed_lines(lnum, 0, curwin->w_cursor.lnum, nr_lines);
  
+ 	/* Set '[ mark. */
+ 	curbuf->b_op_start = curwin->w_cursor;
+ 	curbuf->b_op_start.lnum = lnum;
+ 
  	/* adjust '] mark */
  	curbuf->b_op_end.lnum = curwin->w_cursor.lnum - 1;
  	curbuf->b_op_end.col = bd.textcol + totlen - 1;
***************
*** 3178,3183 ****
--- 3168,3174 ----
  		}
  	    }
  	    new_cursor = curwin->w_cursor;
+ 	    curbuf->b_op_start = curwin->w_cursor;
  	}
  	/*
  	 * Line mode: BACKWARD is the same as FORWARD on the previous line
*** ../vim60.147/src/version.c	Tue Jan 22 15:38:17 2002
--- src/version.c	Tue Jan 22 16:47:25 2002
***************
*** 608,609 ****
--- 608,611 ----
  {   /* Add new patch number below this line */
+ /**/
+     148,
  /**/

--  
Latest survey shows that 3 out of 4 people make up 75% of the 
world's population.

 ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
 \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///