Karsten Hopp c06184
To: vim_dev@googlegroups.com
Karsten Hopp c06184
Subject: Patch 7.4.779
Karsten Hopp c06184
Fcc: outbox
Karsten Hopp c06184
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c06184
Mime-Version: 1.0
Karsten Hopp c06184
Content-Type: text/plain; charset=UTF-8
Karsten Hopp c06184
Content-Transfer-Encoding: 8bit
Karsten Hopp c06184
------------
Karsten Hopp c06184
Karsten Hopp c06184
Patch 7.4.779
Karsten Hopp c06184
Problem:    Using CTRL-A in a line without a number moves the cursor. May
Karsten Hopp c06184
            cause a crash when at the start of the line. (Urtica Dioica)
Karsten Hopp c06184
Solution:   Do not move the cursor if no number was changed.
Karsten Hopp c06184
Files:      src/ops.c
Karsten Hopp c06184
Karsten Hopp c06184
Karsten Hopp c06184
*** ../vim-7.4.778/src/ops.c	2015-07-10 22:37:54.312853901 +0200
Karsten Hopp c06184
--- src/ops.c	2015-07-12 14:56:33.707974480 +0200
Karsten Hopp c06184
***************
Karsten Hopp c06184
*** 5404,5409 ****
Karsten Hopp c06184
--- 5404,5410 ----
Karsten Hopp c06184
      int		lnum = curwin->w_cursor.lnum;
Karsten Hopp c06184
      int		lnume = curwin->w_cursor.lnum;
Karsten Hopp c06184
      int		startcol;
Karsten Hopp c06184
+     int		did_change = FALSE;
Karsten Hopp c06184
  
Karsten Hopp c06184
      dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL);	/* "heX" */
Karsten Hopp c06184
      dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL);	/* "Octal" */
Karsten Hopp c06184
***************
Karsten Hopp c06184
*** 5547,5552 ****
Karsten Hopp c06184
--- 5548,5554 ----
Karsten Hopp c06184
  #endif
Karsten Hopp c06184
  	    }
Karsten Hopp c06184
  	    curwin->w_cursor.col = col;
Karsten Hopp c06184
+ 	    did_change = TRUE;
Karsten Hopp c06184
  	    (void)del_char(FALSE);
Karsten Hopp c06184
  	    ins_char(firstdigit);
Karsten Hopp c06184
  	}
Karsten Hopp c06184
***************
Karsten Hopp c06184
*** 5619,5624 ****
Karsten Hopp c06184
--- 5621,5627 ----
Karsten Hopp c06184
  	     * Delete the old number.
Karsten Hopp c06184
  	     */
Karsten Hopp c06184
  	    curwin->w_cursor.col = col;
Karsten Hopp c06184
+ 	    did_change = TRUE;
Karsten Hopp c06184
  	    todel = length;
Karsten Hopp c06184
  	    c = gchar_cursor();
Karsten Hopp c06184
  
Karsten Hopp c06184
***************
Karsten Hopp c06184
*** 5713,5719 ****
Karsten Hopp c06184
  	RLADDSUBFIX(ptr);
Karsten Hopp c06184
  #endif
Karsten Hopp c06184
      }
Karsten Hopp c06184
!     --curwin->w_cursor.col;
Karsten Hopp c06184
      return OK;
Karsten Hopp c06184
  }
Karsten Hopp c06184
  
Karsten Hopp c06184
--- 5716,5723 ----
Karsten Hopp c06184
  	RLADDSUBFIX(ptr);
Karsten Hopp c06184
  #endif
Karsten Hopp c06184
      }
Karsten Hopp c06184
!     if (did_change && curwin->w_cursor.col > 0)
Karsten Hopp c06184
! 	--curwin->w_cursor.col;
Karsten Hopp c06184
      return OK;
Karsten Hopp c06184
  }
Karsten Hopp c06184
  
Karsten Hopp c06184
*** ../vim-7.4.778/src/version.c	2015-07-10 22:37:54.312853901 +0200
Karsten Hopp c06184
--- src/version.c	2015-07-12 15:01:11.605349725 +0200
Karsten Hopp c06184
***************
Karsten Hopp c06184
*** 743,744 ****
Karsten Hopp c06184
--- 743,746 ----
Karsten Hopp c06184
  {   /* Add new patch number below this line */
Karsten Hopp c06184
+ /**/
Karsten Hopp c06184
+     779,
Karsten Hopp c06184
  /**/
Karsten Hopp c06184
Karsten Hopp c06184
-- 
Karsten Hopp c06184
Your mouse has moved.  Windows must be restarted for the change
Karsten Hopp c06184
to take effect.  Reboot now?
Karsten Hopp c06184
Karsten Hopp c06184
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c06184
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c06184
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp c06184
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///