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