Karsten Hopp f9ad50
To: vim_dev@googlegroups.com
Karsten Hopp f9ad50
Subject: Patch 7.4.073
Karsten Hopp f9ad50
Fcc: outbox
Karsten Hopp f9ad50
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f9ad50
Mime-Version: 1.0
Karsten Hopp f9ad50
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f9ad50
Content-Transfer-Encoding: 8bit
Karsten Hopp f9ad50
------------
Karsten Hopp f9ad50
Karsten Hopp f9ad50
Patch 7.4.073
Karsten Hopp f9ad50
Problem:    Setting undolevels for one buffer changes undo in another.
Karsten Hopp f9ad50
Solution:   Make 'undolevels' a global-local option. (Christian Brabandt)
Karsten Hopp f9ad50
Files:      runtime/doc/options.txt, src/buffer.c, src/option.c, src/option.h
Karsten Hopp f9ad50
            src/structs.h, src/undo.c
Karsten Hopp f9ad50
Karsten Hopp f9ad50
Karsten Hopp f9ad50
*** ../vim-7.4.072/runtime/doc/options.txt	2013-08-10 13:24:57.000000000 +0200
Karsten Hopp f9ad50
--- runtime/doc/options.txt	2013-11-06 04:18:43.000000000 +0100
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 7594,7600 ****
Karsten Hopp f9ad50
  						*'undolevels'* *'ul'*
Karsten Hopp f9ad50
  'undolevels' 'ul'	number	(default 100, 1000 for Unix, VMS,
Karsten Hopp f9ad50
  						Win32 and OS/2)
Karsten Hopp f9ad50
! 			global
Karsten Hopp f9ad50
  			{not in Vi}
Karsten Hopp f9ad50
  	Maximum number of changes that can be undone.  Since undo information
Karsten Hopp f9ad50
  	is kept in memory, higher numbers will cause more memory to be used
Karsten Hopp f9ad50
--- 7594,7600 ----
Karsten Hopp f9ad50
  						*'undolevels'* *'ul'*
Karsten Hopp f9ad50
  'undolevels' 'ul'	number	(default 100, 1000 for Unix, VMS,
Karsten Hopp f9ad50
  						Win32 and OS/2)
Karsten Hopp f9ad50
! 			global or local to buffer |global-local|
Karsten Hopp f9ad50
  			{not in Vi}
Karsten Hopp f9ad50
  	Maximum number of changes that can be undone.  Since undo information
Karsten Hopp f9ad50
  	is kept in memory, higher numbers will cause more memory to be used
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 7605,7612 ****
Karsten Hopp f9ad50
  <	But you can also get Vi compatibility by including the 'u' flag in
Karsten Hopp f9ad50
  	'cpoptions', and still be able to use CTRL-R to repeat undo.
Karsten Hopp f9ad50
  	Also see |undo-two-ways|.
Karsten Hopp f9ad50
! 	Set to a negative number for no undo at all: >
Karsten Hopp f9ad50
! 		set ul=-1
Karsten Hopp f9ad50
  <	This helps when you run out of memory for a single change.
Karsten Hopp f9ad50
  	Also see |clear-undo|.
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
--- 7605,7613 ----
Karsten Hopp f9ad50
  <	But you can also get Vi compatibility by including the 'u' flag in
Karsten Hopp f9ad50
  	'cpoptions', and still be able to use CTRL-R to repeat undo.
Karsten Hopp f9ad50
  	Also see |undo-two-ways|.
Karsten Hopp f9ad50
! 	Set to -1 for no undo at all.  You might want to do this only for the
Karsten Hopp f9ad50
! 	current buffer: >
Karsten Hopp f9ad50
! 		setlocal ul=-1
Karsten Hopp f9ad50
  <	This helps when you run out of memory for a single change.
Karsten Hopp f9ad50
  	Also see |clear-undo|.
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
*** ../vim-7.4.072/src/buffer.c	2013-11-05 17:40:47.000000000 +0100
Karsten Hopp f9ad50
--- src/buffer.c	2013-11-06 04:25:27.000000000 +0100
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 1949,1954 ****
Karsten Hopp f9ad50
--- 1949,1955 ----
Karsten Hopp f9ad50
      clear_string_option(&buf->b_p_qe);
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
      buf->b_p_ar = -1;
Karsten Hopp f9ad50
+     buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
Karsten Hopp f9ad50
  }
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
  /*
Karsten Hopp f9ad50
*** ../vim-7.4.072/src/option.c	2013-11-05 07:12:59.000000000 +0100
Karsten Hopp f9ad50
--- src/option.c	2013-11-06 04:34:23.000000000 +0100
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 234,239 ****
Karsten Hopp f9ad50
--- 234,240 ----
Karsten Hopp f9ad50
  #ifdef FEAT_STL_OPT
Karsten Hopp f9ad50
  # define PV_STL		OPT_BOTH(OPT_WIN(WV_STL))
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
+ #define PV_UL		OPT_BOTH(OPT_BUF(BV_UL))
Karsten Hopp f9ad50
  #ifdef FEAT_WINDOWS
Karsten Hopp f9ad50
  # define PV_WFH		OPT_WIN(WV_WFH)
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 2683,2689 ****
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
  			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
Karsten Hopp f9ad50
      {"undolevels",  "ul",   P_NUM|P_VI_DEF,
Karsten Hopp f9ad50
! 			    (char_u *)&p_ul, PV_NONE,
Karsten Hopp f9ad50
  			    {
Karsten Hopp f9ad50
  #if defined(UNIX) || defined(WIN3264) || defined(OS2) || defined(VMS)
Karsten Hopp f9ad50
  			    (char_u *)1000L,
Karsten Hopp f9ad50
--- 2684,2690 ----
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
  			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
Karsten Hopp f9ad50
      {"undolevels",  "ul",   P_NUM|P_VI_DEF,
Karsten Hopp f9ad50
! 			    (char_u *)&p_ul, PV_UL,
Karsten Hopp f9ad50
  			    {
Karsten Hopp f9ad50
  #if defined(UNIX) || defined(WIN3264) || defined(OS2) || defined(VMS)
Karsten Hopp f9ad50
  			    (char_u *)1000L,
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 3313,3318 ****
Karsten Hopp f9ad50
--- 3314,3320 ----
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
      curbuf->b_p_initialized = TRUE;
Karsten Hopp f9ad50
      curbuf->b_p_ar = -1;	/* no local 'autoread' value */
Karsten Hopp f9ad50
+     curbuf->b_p_ul = NO_LOCAL_UNDOLEVEL;
Karsten Hopp f9ad50
      check_buf_options(curbuf);
Karsten Hopp f9ad50
      check_win_options(curwin);
Karsten Hopp f9ad50
      check_options();
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 4512,4519 ****
Karsten Hopp f9ad50
  						((flags & P_VI_DEF) || cp_val)
Karsten Hopp f9ad50
  						 ?  VI_DEFAULT : VIM_DEFAULT];
Karsten Hopp f9ad50
  			else if (nextchar == '<')
Karsten Hopp f9ad50
! 			    value = *(long *)get_varp_scope(&(options[opt_idx]),
Karsten Hopp f9ad50
! 								  OPT_GLOBAL);
Karsten Hopp f9ad50
  			else if (((long *)varp == &p_wc
Karsten Hopp f9ad50
  				    || (long *)varp == &p_wcm)
Karsten Hopp f9ad50
  				&& (*arg == '<'
Karsten Hopp f9ad50
--- 4514,4529 ----
Karsten Hopp f9ad50
  						((flags & P_VI_DEF) || cp_val)
Karsten Hopp f9ad50
  						 ?  VI_DEFAULT : VIM_DEFAULT];
Karsten Hopp f9ad50
  			else if (nextchar == '<')
Karsten Hopp f9ad50
! 			{
Karsten Hopp f9ad50
! 			    /* For 'undolevels' NO_LOCAL_UNDOLEVEL means to
Karsten Hopp f9ad50
! 			     * use the global value. */
Karsten Hopp f9ad50
! 			    if ((long *)varp == &curbuf->b_p_ul
Karsten Hopp f9ad50
! 						    && opt_flags == OPT_LOCAL)
Karsten Hopp f9ad50
! 				value = NO_LOCAL_UNDOLEVEL;
Karsten Hopp f9ad50
! 			    else
Karsten Hopp f9ad50
! 				value = *(long *)get_varp_scope(
Karsten Hopp f9ad50
! 					     &(options[opt_idx]), OPT_GLOBAL);
Karsten Hopp f9ad50
! 			}
Karsten Hopp f9ad50
  			else if (((long *)varp == &p_wc
Karsten Hopp f9ad50
  				    || (long *)varp == &p_wcm)
Karsten Hopp f9ad50
  				&& (*arg == '<'
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 8487,8492 ****
Karsten Hopp f9ad50
--- 8497,8509 ----
Karsten Hopp f9ad50
  	u_sync(TRUE);
Karsten Hopp f9ad50
  	p_ul = value;
Karsten Hopp f9ad50
      }
Karsten Hopp f9ad50
+     else if (pp == &curbuf->b_p_ul)
Karsten Hopp f9ad50
+     {
Karsten Hopp f9ad50
+ 	/* use the old value, otherwise u_sync() may not work properly */
Karsten Hopp f9ad50
+ 	curbuf->b_p_ul = old_value;
Karsten Hopp f9ad50
+ 	u_sync(TRUE);
Karsten Hopp f9ad50
+ 	curbuf->b_p_ul = value;
Karsten Hopp f9ad50
+     }
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
  #ifdef FEAT_LINEBREAK
Karsten Hopp f9ad50
      /* 'numberwidth' must be positive */
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 9720,9726 ****
Karsten Hopp f9ad50
  /*
Karsten Hopp f9ad50
   * Unset local option value, similar to ":set opt<".
Karsten Hopp f9ad50
   */
Karsten Hopp f9ad50
- 
Karsten Hopp f9ad50
      void
Karsten Hopp f9ad50
  unset_global_local_option(name, from)
Karsten Hopp f9ad50
      char_u	*name;
Karsten Hopp f9ad50
--- 9737,9742 ----
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 9793,9798 ****
Karsten Hopp f9ad50
--- 9809,9817 ----
Karsten Hopp f9ad50
  	    clear_string_option(&((win_T *)from)->w_p_stl);
Karsten Hopp f9ad50
  	    break;
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
+ 	case PV_UL:
Karsten Hopp f9ad50
+ 	    buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
Karsten Hopp f9ad50
+ 	    break;
Karsten Hopp f9ad50
      }
Karsten Hopp f9ad50
  }
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 9841,9846 ****
Karsten Hopp f9ad50
--- 9860,9866 ----
Karsten Hopp f9ad50
  #ifdef FEAT_STL_OPT
Karsten Hopp f9ad50
  	    case PV_STL:  return (char_u *)&(curwin->w_p_stl);
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
+ 	    case PV_UL:   return (char_u *)&(curbuf->b_p_ul);
Karsten Hopp f9ad50
  	}
Karsten Hopp f9ad50
  	return NULL; /* "cannot happen" */
Karsten Hopp f9ad50
      }
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 9905,9910 ****
Karsten Hopp f9ad50
--- 9925,9932 ----
Karsten Hopp f9ad50
  	case PV_STL:	return *curwin->w_p_stl != NUL
Karsten Hopp f9ad50
  				    ? (char_u *)&(curwin->w_p_stl) : p->var;
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
+ 	case PV_UL:	return curbuf->b_p_ul != NO_LOCAL_UNDOLEVEL
Karsten Hopp f9ad50
+ 				    ? (char_u *)&(curbuf->b_p_ul) : p->var;
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
  #ifdef FEAT_ARABIC
Karsten Hopp f9ad50
  	case PV_ARAB:	return (char_u *)&(curwin->w_p_arab);
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 10445,10450 ****
Karsten Hopp f9ad50
--- 10467,10473 ----
Karsten Hopp f9ad50
  	    /* options that are normally global but also have a local value
Karsten Hopp f9ad50
  	     * are not copied, start using the global value */
Karsten Hopp f9ad50
  	    buf->b_p_ar = -1;
Karsten Hopp f9ad50
+ 	    buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
Karsten Hopp f9ad50
  #ifdef FEAT_QUICKFIX
Karsten Hopp f9ad50
  	    buf->b_p_gp = empty_option;
Karsten Hopp f9ad50
  	    buf->b_p_mp = empty_option;
Karsten Hopp f9ad50
*** ../vim-7.4.072/src/option.h	2013-06-26 18:41:39.000000000 +0200
Karsten Hopp f9ad50
--- src/option.h	2013-11-06 04:17:40.000000000 +0100
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 1031,1036 ****
Karsten Hopp f9ad50
--- 1031,1037 ----
Karsten Hopp f9ad50
      , BV_TW
Karsten Hopp f9ad50
      , BV_TX
Karsten Hopp f9ad50
      , BV_UDF
Karsten Hopp f9ad50
+     , BV_UL
Karsten Hopp f9ad50
      , BV_WM
Karsten Hopp f9ad50
      , BV_COUNT	    /* must be the last one */
Karsten Hopp f9ad50
  };
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 1109,1111 ****
Karsten Hopp f9ad50
--- 1110,1115 ----
Karsten Hopp f9ad50
      , WV_WRAP
Karsten Hopp f9ad50
      , WV_COUNT	    /* must be the last one */
Karsten Hopp f9ad50
  };
Karsten Hopp f9ad50
+ 
Karsten Hopp f9ad50
+ /* Value for b_p_ul indicating the global value must be used. */
Karsten Hopp f9ad50
+ #define NO_LOCAL_UNDOLEVEL -123456
Karsten Hopp f9ad50
*** ../vim-7.4.072/src/structs.h	2013-11-05 07:12:59.000000000 +0100
Karsten Hopp f9ad50
--- src/structs.h	2013-11-06 04:26:17.000000000 +0100
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 1627,1632 ****
Karsten Hopp f9ad50
--- 1627,1633 ----
Karsten Hopp f9ad50
      char_u	*b_p_dict;	/* 'dictionary' local value */
Karsten Hopp f9ad50
      char_u	*b_p_tsr;	/* 'thesaurus' local value */
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
+     long	b_p_ul;		/* 'undolevels' local value */
Karsten Hopp f9ad50
  #ifdef FEAT_PERSISTENT_UNDO
Karsten Hopp f9ad50
      int		b_p_udf;	/* 'undofile' */
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
*** ../vim-7.4.072/src/undo.c	2013-09-08 15:40:45.000000000 +0200
Karsten Hopp f9ad50
--- src/undo.c	2013-11-06 04:33:12.000000000 +0100
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 83,88 ****
Karsten Hopp f9ad50
--- 83,89 ----
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
  #include "vim.h"
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
+ static long get_undolevel __ARGS((void));
Karsten Hopp f9ad50
  static void u_unch_branch __ARGS((u_header_T *uhp));
Karsten Hopp f9ad50
  static u_entry_T *u_get_headentry __ARGS((void));
Karsten Hopp f9ad50
  static void u_getbot __ARGS((void));
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 336,341 ****
Karsten Hopp f9ad50
--- 337,353 ----
Karsten Hopp f9ad50
  }
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
  /*
Karsten Hopp f9ad50
+  * Get the undolevle value for the current buffer.
Karsten Hopp f9ad50
+  */
Karsten Hopp f9ad50
+     static long
Karsten Hopp f9ad50
+ get_undolevel()
Karsten Hopp f9ad50
+ {
Karsten Hopp f9ad50
+     if (curbuf->b_p_ul == NO_LOCAL_UNDOLEVEL)
Karsten Hopp f9ad50
+ 	return p_ul;
Karsten Hopp f9ad50
+     return curbuf->b_p_ul;
Karsten Hopp f9ad50
+ }
Karsten Hopp f9ad50
+ 
Karsten Hopp f9ad50
+ /*
Karsten Hopp f9ad50
   * Common code for various ways to save text before a change.
Karsten Hopp f9ad50
   * "top" is the line above the first changed line.
Karsten Hopp f9ad50
   * "bot" is the line below the last changed line.
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 419,425 ****
Karsten Hopp f9ad50
  	curbuf->b_new_change = TRUE;
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
! 	if (p_ul >= 0)
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
  	    /*
Karsten Hopp f9ad50
  	     * Make a new header entry.  Do this first so that we don't mess
Karsten Hopp f9ad50
--- 431,437 ----
Karsten Hopp f9ad50
  	curbuf->b_new_change = TRUE;
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
! 	if (get_undolevel() >= 0)
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
  	    /*
Karsten Hopp f9ad50
  	     * Make a new header entry.  Do this first so that we don't mess
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 449,455 ****
Karsten Hopp f9ad50
  	/*
Karsten Hopp f9ad50
  	 * free headers to keep the size right
Karsten Hopp f9ad50
  	 */
Karsten Hopp f9ad50
! 	while (curbuf->b_u_numhead > p_ul && curbuf->b_u_oldhead != NULL)
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
  	    u_header_T	    *uhfree = curbuf->b_u_oldhead;
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
--- 461,468 ----
Karsten Hopp f9ad50
  	/*
Karsten Hopp f9ad50
  	 * free headers to keep the size right
Karsten Hopp f9ad50
  	 */
Karsten Hopp f9ad50
! 	while (curbuf->b_u_numhead > get_undolevel()
Karsten Hopp f9ad50
! 					       && curbuf->b_u_oldhead != NULL)
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
  	    u_header_T	    *uhfree = curbuf->b_u_oldhead;
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 530,536 ****
Karsten Hopp f9ad50
      }
Karsten Hopp f9ad50
      else
Karsten Hopp f9ad50
      {
Karsten Hopp f9ad50
! 	if (p_ul < 0)		/* no undo at all */
Karsten Hopp f9ad50
  	    return OK;
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
  	/*
Karsten Hopp f9ad50
--- 543,549 ----
Karsten Hopp f9ad50
      }
Karsten Hopp f9ad50
      else
Karsten Hopp f9ad50
      {
Karsten Hopp f9ad50
! 	if (get_undolevel() < 0)	/* no undo at all */
Karsten Hopp f9ad50
  	    return OK;
Karsten Hopp f9ad50
  
Karsten Hopp f9ad50
  	/*
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 1972,1978 ****
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
  	    if (curbuf->b_u_curhead == NULL)		/* first undo */
Karsten Hopp f9ad50
  		curbuf->b_u_curhead = curbuf->b_u_newhead;
Karsten Hopp f9ad50
! 	    else if (p_ul > 0)				/* multi level undo */
Karsten Hopp f9ad50
  		/* get next undo */
Karsten Hopp f9ad50
  		curbuf->b_u_curhead = curbuf->b_u_curhead->uh_next.ptr;
Karsten Hopp f9ad50
  	    /* nothing to undo */
Karsten Hopp f9ad50
--- 1985,1991 ----
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
  	    if (curbuf->b_u_curhead == NULL)		/* first undo */
Karsten Hopp f9ad50
  		curbuf->b_u_curhead = curbuf->b_u_newhead;
Karsten Hopp f9ad50
! 	    else if (get_undolevel() > 0)		/* multi level undo */
Karsten Hopp f9ad50
  		/* get next undo */
Karsten Hopp f9ad50
  		curbuf->b_u_curhead = curbuf->b_u_curhead->uh_next.ptr;
Karsten Hopp f9ad50
  	    /* nothing to undo */
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 1993,1999 ****
Karsten Hopp f9ad50
  	}
Karsten Hopp f9ad50
  	else
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
! 	    if (curbuf->b_u_curhead == NULL || p_ul <= 0)
Karsten Hopp f9ad50
  	    {
Karsten Hopp f9ad50
  		beep_flush();	/* nothing to redo */
Karsten Hopp f9ad50
  		if (count == startcount - 1)
Karsten Hopp f9ad50
--- 2006,2012 ----
Karsten Hopp f9ad50
  	}
Karsten Hopp f9ad50
  	else
Karsten Hopp f9ad50
  	{
Karsten Hopp f9ad50
! 	    if (curbuf->b_u_curhead == NULL || get_undolevel() <= 0)
Karsten Hopp f9ad50
  	    {
Karsten Hopp f9ad50
  		beep_flush();	/* nothing to redo */
Karsten Hopp f9ad50
  		if (count == startcount - 1)
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 2751,2757 ****
Karsten Hopp f9ad50
      if (im_is_preediting())
Karsten Hopp f9ad50
  	return;		    /* XIM is busy, don't break an undo sequence */
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
!     if (p_ul < 0)
Karsten Hopp f9ad50
  	curbuf->b_u_synced = TRUE;  /* no entries, nothing to do */
Karsten Hopp f9ad50
      else
Karsten Hopp f9ad50
      {
Karsten Hopp f9ad50
--- 2764,2770 ----
Karsten Hopp f9ad50
      if (im_is_preediting())
Karsten Hopp f9ad50
  	return;		    /* XIM is busy, don't break an undo sequence */
Karsten Hopp f9ad50
  #endif
Karsten Hopp f9ad50
!     if (get_undolevel() < 0)
Karsten Hopp f9ad50
  	curbuf->b_u_synced = TRUE;  /* no entries, nothing to do */
Karsten Hopp f9ad50
      else
Karsten Hopp f9ad50
      {
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 2911,2917 ****
Karsten Hopp f9ad50
      }
Karsten Hopp f9ad50
      if (!curbuf->b_u_synced)
Karsten Hopp f9ad50
  	return;		    /* already unsynced */
Karsten Hopp f9ad50
!     if (p_ul < 0)
Karsten Hopp f9ad50
  	return;		    /* no entries, nothing to do */
Karsten Hopp f9ad50
      else
Karsten Hopp f9ad50
      {
Karsten Hopp f9ad50
--- 2924,2930 ----
Karsten Hopp f9ad50
      }
Karsten Hopp f9ad50
      if (!curbuf->b_u_synced)
Karsten Hopp f9ad50
  	return;		    /* already unsynced */
Karsten Hopp f9ad50
!     if (get_undolevel() < 0)
Karsten Hopp f9ad50
  	return;		    /* no entries, nothing to do */
Karsten Hopp f9ad50
      else
Karsten Hopp f9ad50
      {
Karsten Hopp f9ad50
*** ../vim-7.4.072/src/version.c	2013-11-06 04:04:29.000000000 +0100
Karsten Hopp f9ad50
--- src/version.c	2013-11-06 05:21:43.000000000 +0100
Karsten Hopp f9ad50
***************
Karsten Hopp f9ad50
*** 740,741 ****
Karsten Hopp f9ad50
--- 740,743 ----
Karsten Hopp f9ad50
  {   /* Add new patch number below this line */
Karsten Hopp f9ad50
+ /**/
Karsten Hopp f9ad50
+     73,
Karsten Hopp f9ad50
  /**/
Karsten Hopp f9ad50
Karsten Hopp f9ad50
-- 
Karsten Hopp f9ad50
Living on Earth includes an annual free trip around the Sun.
Karsten Hopp f9ad50
Karsten Hopp f9ad50
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f9ad50
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f9ad50
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp f9ad50
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///