Compare commits

...

21 Commits

Author SHA1 Message Date
Bram Moolenaar
8e8fe9b2b8 updated for version 7.2-136 2009-03-11 14:37:32 +00:00
Bram Moolenaar
60f39aecb1 updated for version 7.2-135 2009-03-11 14:10:38 +00:00
Bram Moolenaar
5d294d19b4 updated for version 7.2-134 2009-03-11 12:11:02 +00:00
Bram Moolenaar
21fa1ed4b5 updated for version 7.2-133 2009-03-11 11:47:18 +00:00
Bram Moolenaar
bf1b7a7efe updated for version 7.2-132 2009-03-05 02:15:53 +00:00
Bram Moolenaar
fab0623bcf updated for version 7.2-131 2009-03-04 03:13:35 +00:00
Bram Moolenaar
76243bd847 updated for version 7.2-130 2009-03-02 01:47:02 +00:00
Bram Moolenaar
e8bd5cea37 updated for version 7.2-129 2009-03-02 01:12:48 +00:00
Bram Moolenaar
c0b3565d55 updated for version 7.2-128 2009-03-01 01:45:35 +00:00
Bram Moolenaar
51306d2d8f updated for version 7.2-127 2009-02-24 03:38:04 +00:00
Bram Moolenaar
de0dfed701 updated for version 7.2-126 2009-02-24 03:30:14 +00:00
Bram Moolenaar
e4bfca808d updated for version 7.2-125 2009-02-24 03:12:40 +00:00
Bram Moolenaar
f08fa44a1a updated for version 7.2-124 2009-02-22 23:54:59 +00:00
Bram Moolenaar
fa47a9218d updated for version 7.2-123 2009-02-22 22:43:27 +00:00
Bram Moolenaar
87e817c586 updated for version 7.2-122 2009-02-22 20:13:39 +00:00
Bram Moolenaar
b3dc8fd3fd updated for version 7.2-121 2009-02-22 01:52:59 +00:00
Bram Moolenaar
884ae6446f updated for version 7.2-120 2009-02-22 01:37:59 +00:00
Bram Moolenaar
ffcce30fdb updated for version 7.2-119 2009-02-22 00:14:58 +00:00
Bram Moolenaar
2a9e4df9fb updated for version 7.2-118 2009-02-21 23:59:19 +00:00
Bram Moolenaar
bb9c7d1cc5 updated for version 7.2-117 2009-02-21 23:03:09 +00:00
Bram Moolenaar
086fad3a27 updated for version 7.2-116 2009-02-21 21:58:24 +00:00
24 changed files with 472 additions and 135 deletions

61
src/auto/configure vendored
View File

@@ -11565,6 +11565,67 @@ _ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5
$as_echo_n "checking for working volatile... " >&6; }
if test "${ac_cv_c_volatile+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
volatile int x;
int * volatile y = (int *) 0;
return !x && !y;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_volatile=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_volatile=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5
$as_echo "$ac_cv_c_volatile" >&6; }
if test $ac_cv_c_volatile = no; then
cat >>confdefs.h <<\_ACEOF
#define volatile /**/
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5
$as_echo_n "checking for mode_t... " >&6; }
if test "${ac_cv_type_mode_t+set}" = set; then

View File

@@ -5098,7 +5098,8 @@ buf_spname(buf)
*/
FOR_ALL_TAB_WINDOWS(tp, win)
if (win->w_buffer == buf)
break;
goto win_found;
win_found:
if (win != NULL && win->w_llist_ref != NULL)
return _("[Location List]");
else

View File

@@ -50,6 +50,9 @@
/* Define to empty if the keyword does not work. */
#undef const
/* Define to empty if the keyword does not work. */
#undef volatile
/* Define to `int' if <sys/types.h> doesn't define. */
#undef mode_t

View File

@@ -2148,6 +2148,7 @@ fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_PROG_GCC_TRADITIONAL
AC_C_CONST
AC_C_VOLATILE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T

View File

@@ -1153,7 +1153,7 @@ ex_diffoff(eap)
for (wp = firstwin; wp != NULL; wp = wp->w_next)
{
if (wp == curwin || eap->forceit)
if (wp == curwin || (eap->forceit && wp->w_p_diff))
{
/* Set 'diff', 'scrollbind' off and 'wrap' on. */
wp->w_p_diff = FALSE;

View File

@@ -6541,6 +6541,7 @@ static sign_T *first_sign = NULL;
static int last_sign_typenr = MAX_TYPENR; /* is decremented */
static void sign_list_defined __ARGS((sign_T *sp));
static void sign_undefine __ARGS((sign_T *sp, sign_T *sp_prev));
/*
* ":sign" command
@@ -6749,24 +6750,8 @@ ex_sign(eap)
/* ":sign list {name}" */
sign_list_defined(sp);
else
{
/* ":sign undefine {name}" */
vim_free(sp->sn_name);
vim_free(sp->sn_icon);
#ifdef FEAT_SIGN_ICONS
if (sp->sn_image != NULL)
{
out_flush();
gui_mch_destroy_sign(sp->sn_image);
}
#endif
vim_free(sp->sn_text);
if (sp_prev == NULL)
first_sign = sp->sn_next;
else
sp_prev->sn_next = sp->sn_next;
vim_free(sp);
}
sign_undefine(sp, sp_prev);
}
}
else
@@ -7014,6 +6999,31 @@ sign_list_defined(sp)
}
}
/*
* Undefine a sign and free its memory.
*/
static void
sign_undefine(sp, sp_prev)
sign_T *sp;
sign_T *sp_prev;
{
vim_free(sp->sn_name);
vim_free(sp->sn_icon);
#ifdef FEAT_SIGN_ICONS
if (sp->sn_image != NULL)
{
out_flush();
gui_mch_destroy_sign(sp->sn_image);
}
#endif
vim_free(sp->sn_text);
if (sp_prev == NULL)
first_sign = sp->sn_next;
else
sp_prev->sn_next = sp->sn_next;
vim_free(sp);
}
/*
* Get highlighting attribute for sign "typenr".
* If "line" is TRUE: line highl, if FALSE: text highl.
@@ -7088,6 +7098,18 @@ sign_typenr2name(typenr)
return (char_u *)_("[Deleted]");
}
#if defined(EXITFREE) || defined(PROTO)
/*
* Undefine/free all signs.
*/
void
free_signs()
{
while (first_sign != NULL)
sign_undefine(first_sign, NULL);
}
#endif
#endif
#if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO)

View File

@@ -5124,7 +5124,11 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
}
vim_free(cmd->uc_rep);
cmd->uc_rep = 0;
cmd->uc_rep = NULL;
#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
vim_free(cmd->uc_compl_arg);
cmd->uc_compl_arg = NULL;
#endif
break;
}
@@ -5941,7 +5945,7 @@ do_ucmd(eap)
for (;;)
{
p = cmd->uc_rep; /* source */
q = buf; /* destinateion */
q = buf; /* destination */
totlen = 0;
for (;;)
@@ -7846,6 +7850,9 @@ free_cd_dir()
{
vim_free(prev_dir);
prev_dir = NULL;
vim_free(globaldir);
globaldir = NULL;
}
#endif
@@ -7868,6 +7875,10 @@ ex_cd(eap)
else
#endif
{
#ifdef FEAT_AUTOCMD
if (allbuf_locked())
return;
#endif
if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged()
&& !eap->forceit)
{
@@ -8792,7 +8803,7 @@ ex_mkrc(eap)
else if (*dirnow != NUL
&& (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
{
if (mch_chdir((char *)globaldir) == OK)
if (mch_chdir((char *)globaldir) == 0)
shorten_fnames(TRUE);
}

View File

@@ -2000,8 +2000,8 @@ text_locked_msg()
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Check if "curbuf_lock" is set and return TRUE when it is and give an error
* message.
* Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is
* and give an error message.
*/
int
curbuf_locked()
@@ -2011,6 +2011,21 @@ curbuf_locked()
EMSG(_("E788: Not allowed to edit another buffer now"));
return TRUE;
}
return allbuf_locked();
}
/*
* Check if "allbuf_lock" is set and return TRUE when it is and give an error
* message.
*/
int
allbuf_locked()
{
if (allbuf_lock > 0)
{
EMSG(_("E811: Not allowed to change buffer information now"));
return TRUE;
}
return FALSE;
}
#endif
@@ -6047,9 +6062,7 @@ ex_window()
# endif
return K_IGNORE;
}
cmdwin_type = ccline.cmdfirstc;
if (cmdwin_type == NUL)
cmdwin_type = '-';
cmdwin_type = get_cmdline_type();
/* Create the command-line buffer empty. */
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
@@ -6073,7 +6086,7 @@ ex_window()
/* Showing the prompt may have set need_wait_return, reset it. */
need_wait_return = FALSE;
histtype = hist_char2type(ccline.cmdfirstc);
histtype = hist_char2type(cmdwin_type);
if (histtype == HIST_CMD || histtype == HIST_DEBUG)
{
if (p_wc == TAB)

View File

@@ -69,7 +69,7 @@ static int apply_autocmds_exarg __ARGS((event_T event, char_u *fname, char_u *fn
static int au_find_group __ARGS((char_u *name));
# define AUGROUP_DEFAULT -1 /* default autocmd group */
# define AUGROUP_ERROR -2 /* errornouse autocmd group */
# define AUGROUP_ERROR -2 /* erroneous autocmd group */
# define AUGROUP_ALL -3 /* all autocmd groups */
#endif
@@ -144,7 +144,9 @@ static int get_mac_fio_flags __ARGS((char_u *ptr));
# endif
#endif
static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf));
#ifdef FEAT_AUTOCMD
static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
#endif
void
filemess(buf, name, s, attr)
@@ -295,6 +297,19 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
int conv_restlen = 0; /* nr of bytes in conv_rest[] */
#endif
#ifdef FEAT_AUTOCMD
/* Remember the initial values of curbuf, curbuf->b_ffname and
* curbuf->b_fname to detect whether they are altered as a result of
* executing nasty autocommands. Also check if "fname" and "sfname"
* point to one of these values. */
buf_T *old_curbuf = curbuf;
char_u *old_b_ffname = curbuf->b_ffname;
char_u *old_b_fname = curbuf->b_fname;
int using_b_ffname = (fname == curbuf->b_ffname)
|| (sfname == curbuf->b_ffname);
int using_b_fname = (fname == curbuf->b_fname)
|| (sfname == curbuf->b_fname);
#endif
write_no_eol_lnum = 0; /* in case it was set by the previous read */
/*
@@ -589,7 +604,21 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#ifdef FEAT_QUICKFIX
if (!bt_dontwrite(curbuf))
#endif
{
check_need_swap(newfile);
#ifdef FEAT_AUTOCMD
/* SwapExists autocommand may mess things up */
if (curbuf != old_curbuf
|| (using_b_ffname
&& (old_b_ffname != curbuf->b_ffname))
|| (using_b_fname
&& (old_b_fname != curbuf->b_fname)))
{
EMSG(_(e_auchangedbuf));
return FAIL;
}
#endif
}
if (dir_of_file_exists(fname))
filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
else
@@ -668,6 +697,17 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#endif
{
check_need_swap(newfile);
#ifdef FEAT_AUTOCMD
if (!read_stdin && (curbuf != old_curbuf
|| (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
|| (using_b_fname && (old_b_fname != curbuf->b_fname))))
{
EMSG(_(e_auchangedbuf));
if (!read_buffer)
close(fd);
return FAIL;
}
#endif
#ifdef UNIX
/* Set swap file protection bits after creating it. */
if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL)
@@ -698,7 +738,6 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
{
int m = msg_scroll;
int n = msg_scrolled;
buf_T *old_curbuf = curbuf;
/*
* The file must be closed again, the autocommands may want to change
@@ -740,8 +779,13 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
/*
* Don't allow the autocommands to change the current buffer.
* Try to re-open the file.
*
* Don't allow the autocommands to change the buffer name either
* (cd for example) if it invalidates fname or sfname.
*/
if (!read_stdin && (curbuf != old_curbuf
|| (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
|| (using_b_fname && (old_b_fname != curbuf->b_fname))
|| (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) < 0))
{
--no_wait_return;
@@ -5244,13 +5288,16 @@ buf_write_bytes(ip)
/* Convert with iconv(). */
if (ip->bw_restlen > 0)
{
char *fp;
/* Need to concatenate the remainder of the previous call and
* the bytes of the current call. Use the end of the
* conversion buffer for this. */
fromlen = len + ip->bw_restlen;
from = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen;
mch_memmove((void *)from, ip->bw_rest, (size_t)ip->bw_restlen);
mch_memmove((void *)(from + ip->bw_restlen), buf, (size_t)len);
fp = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen;
mch_memmove(fp, ip->bw_rest, (size_t)ip->bw_restlen);
mch_memmove(fp + ip->bw_restlen, buf, (size_t)len);
from = fp;
tolen = ip->bw_conv_buflen - fromlen;
}
else
@@ -6320,7 +6367,7 @@ check_timestamps(focus)
if (!stuff_empty() || global_busy || !typebuf_typed()
#ifdef FEAT_AUTOCMD
|| autocmd_busy || curbuf_lock > 0
|| autocmd_busy || curbuf_lock > 0 || allbuf_lock > 0
#endif
)
need_check_timestamps = TRUE; /* check later */
@@ -6522,8 +6569,10 @@ buf_check_timestamp(buf, focus)
set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1);
set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1);
# endif
++allbuf_lock;
n = apply_autocmds(EVENT_FILECHANGEDSHELL,
buf->b_fname, buf->b_fname, FALSE, buf);
--allbuf_lock;
busy = FALSE;
if (n)
{

View File

@@ -3816,7 +3816,11 @@ showmap(mp, local)
int len = 1;
if (msg_didout || msg_silent != 0)
{
msg_putchar('\n');
if (got_int) /* 'q' typed at MORE prompt */
return;
}
if ((mp->m_mode & (INSERT + CMDLINE)) == INSERT + CMDLINE)
msg_putchar('!'); /* :map! */
else if (mp->m_mode & INSERT)

View File

@@ -482,8 +482,10 @@ EXTERN char *foreground_argument INIT(= NULL);
/*
* While executing external commands or in Ex mode, should not insert GUI
* events in the input buffer: Set hold_gui_events to non-zero.
*
* volatile because it is used in signal handler sig_sysmouse().
*/
EXTERN int hold_gui_events INIT(= 0);
EXTERN volatile int hold_gui_events INIT(= 0);
/*
* When resizing the shell is postponed, remember the new size, and call
@@ -597,7 +599,8 @@ EXTERN int exiting INIT(= FALSE);
EXTERN int really_exiting INIT(= FALSE);
/* TRUE when we are sure to exit, e.g., after
* a deadly signal */
EXTERN int full_screen INIT(= FALSE);
/* volatile because it is used in signal handler deathtrap(). */
EXTERN volatile int full_screen INIT(= FALSE);
/* TRUE when doing full-screen output
* otherwise only writing some messages */
@@ -616,6 +619,11 @@ EXTERN int textlock INIT(= 0);
EXTERN int curbuf_lock INIT(= 0);
/* non-zero when the current buffer can't be
* changed. Used for FileChangedRO. */
EXTERN int allbuf_lock INIT(= 0);
/* non-zero when no buffer name can be
* changed, no buffer can be deleted and
* current directory can't be changed.
* Used for SwapExists et al. */
#endif
#ifdef FEAT_EVAL
# define HAVE_SANDBOX
@@ -739,10 +747,12 @@ EXTERN JMP_BUF x_jump_env;
*/
EXTERN JMP_BUF lc_jump_env; /* argument to SETJMP() */
# ifdef SIGHASARG
EXTERN int lc_signal; /* catched signal number, 0 when no was signal
catched; used for mch_libcall() */
/* volatile because it is used in signal handlers. */
EXTERN volatile int lc_signal; /* caught signal number, 0 when no was signal
caught; used for mch_libcall() */
# endif
EXTERN int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */
/* volatile because it is used in signal handler deathtrap(). */
EXTERN volatile int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */
#endif
#if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
@@ -986,7 +996,8 @@ EXTERN int curscript INIT(= 0); /* index in scriptin[] */
EXTERN FILE *scriptout INIT(= NULL); /* stream to write script to */
EXTERN int read_cmd_fd INIT(= 0); /* fd to read commands from */
EXTERN int got_int INIT(= FALSE); /* set to TRUE when interrupt
/* volatile because it is used in signal handler catch_sigint(). */
EXTERN volatile int got_int INIT(= FALSE); /* set to TRUE when interrupt
signal occurred */
#ifdef USE_TERM_CONSOLE
EXTERN int term_console INIT(= FALSE); /* set to TRUE when console used */

View File

@@ -1587,6 +1587,8 @@ gui_mch_uninit()
XtCloseDisplay(gui.dpy);
gui.dpy = NULL;
vimShell = (Widget)0;
vim_free(gui_argv);
gui_argv = NULL;
}
/*
@@ -1761,6 +1763,8 @@ gui_mch_exit(rc)
* says that this isn't needed when exiting, so just skip it. */
XtCloseDisplay(gui.dpy);
#endif
vim_free(gui_argv);
gui_argv = NULL;
}
/*
@@ -3439,47 +3443,37 @@ gui_mch_register_sign(signfile)
char_u *signfile;
{
XpmAttributes attrs;
XImage *sign;
XImage *sign = NULL;
int status;
/*
* Setup the color substitution table.
*/
sign = NULL;
if (signfile[0] != NUL && signfile[0] != '-')
{
sign = (XImage *)alloc(sizeof(XImage));
if (sign != NULL)
XpmColorSymbol color[5] =
{
XpmColorSymbol color[5] =
{
{"none", NULL, 0},
{"iconColor1", NULL, 0},
{"bottomShadowColor", NULL, 0},
{"topShadowColor", NULL, 0},
{"selectColor", NULL, 0}
};
attrs.valuemask = XpmColorSymbols;
attrs.numsymbols = 2;
attrs.colorsymbols = color;
attrs.colorsymbols[0].pixel = gui.back_pixel;
attrs.colorsymbols[1].pixel = gui.norm_pixel;
status = XpmReadFileToImage(gui.dpy, (char *)signfile,
{"none", NULL, 0},
{"iconColor1", NULL, 0},
{"bottomShadowColor", NULL, 0},
{"topShadowColor", NULL, 0},
{"selectColor", NULL, 0}
};
attrs.valuemask = XpmColorSymbols;
attrs.numsymbols = 2;
attrs.colorsymbols = color;
attrs.colorsymbols[0].pixel = gui.back_pixel;
attrs.colorsymbols[1].pixel = gui.norm_pixel;
status = XpmReadFileToImage(gui.dpy, (char *)signfile,
&sign, NULL, &attrs);
if (status == 0)
{
/* Sign width is fixed at two columns now.
if (sign->width > gui.sign_width)
gui.sign_width = sign->width + 8; */
}
else
{
vim_free(sign);
sign = NULL;
EMSG(_(e_signdata));
}
if (status == 0)
{
/* Sign width is fixed at two columns now.
if (sign->width > gui.sign_width)
gui.sign_width = sign->width + 8; */
}
else
EMSG(_(e_signdata));
}
return (void *)sign;
@@ -3489,8 +3483,7 @@ gui_mch_register_sign(signfile)
gui_mch_destroy_sign(sign)
void *sign;
{
XFree(((XImage *)sign)->data);
vim_free(sign);
XDestroyImage((XImage*)sign);
}
#endif

View File

@@ -976,7 +976,7 @@ wait_return(redraw)
}
}
else if (msg_scrolled > Rows - 2
&& (c == 'j' || c == K_DOWN || c == 'd'))
&& (c == 'j' || c == K_DOWN || c == 'd' || c == 'f'))
c = K_IGNORE;
}
} while ((had_got_int && c == Ctrl_C)
@@ -2504,7 +2504,6 @@ do_more_prompt(typed_char)
break;
case 'u': /* Up half a page */
case K_PAGEUP:
scroll = -(Rows / 2);
break;
@@ -2513,10 +2512,12 @@ do_more_prompt(typed_char)
break;
case 'b': /* one page back */
case K_PAGEUP:
scroll = -(Rows - 1);
break;
case ' ': /* one extra page */
case 'f':
case K_PAGEDOWN:
case K_LEFTMOUSE:
scroll = Rows - 1;
@@ -2552,7 +2553,6 @@ do_more_prompt(typed_char)
{
/* Jump to the choices of the dialog. */
retval = TRUE;
lines_left = Rows - 1;
}
else
#endif
@@ -2560,6 +2560,9 @@ do_more_prompt(typed_char)
got_int = TRUE;
quit_more = TRUE;
}
/* When there is some more output (wrapping line) display that
* without another prompt. */
lines_left = Rows - 1;
break;
#ifdef FEAT_CLIPBOARD

View File

@@ -1010,6 +1010,9 @@ free_all_mem()
# if defined(FEAT_PROFILE)
do_cmdline_cmd((char_u *)"profdel *");
# endif
# if defined(FEAT_KEYMAP)
do_cmdline_cmd((char_u *)"set keymap=");
#endif
# ifdef FEAT_TITLE
free_titles();
@@ -1034,6 +1037,9 @@ free_all_mem()
free_regexp_stuff();
free_tag_stuff();
free_cd_dir();
# ifdef FEAT_SIGNS
free_signs();
# endif
# ifdef FEAT_EVAL
set_expr_line(NULL);
# endif

View File

@@ -5797,14 +5797,28 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
/* load or unload key mapping tables */
errmsg = keymap_init();
/* When successfully installed a new keymap switch on using it. */
if (*curbuf->b_p_keymap != NUL && errmsg == NULL)
if (errmsg == NULL)
{
curbuf->b_p_iminsert = B_IMODE_LMAP;
if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
curbuf->b_p_imsearch = B_IMODE_LMAP;
set_iminsert_global();
set_imsearch_global();
if (*curbuf->b_p_keymap != NUL)
{
/* Installed a new keymap, switch on using it. */
curbuf->b_p_iminsert = B_IMODE_LMAP;
if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
curbuf->b_p_imsearch = B_IMODE_LMAP;
}
else
{
/* Cleared the keymap, may reset 'iminsert' and 'imsearch'. */
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
curbuf->b_p_iminsert = B_IMODE_NONE;
if (curbuf->b_p_imsearch == B_IMODE_LMAP)
curbuf->b_p_imsearch = B_IMODE_USE_INSERT;
}
if ((opt_flags & OPT_LOCAL) == 0)
{
set_iminsert_global();
set_imsearch_global();
}
# ifdef FEAT_WINDOWS
status_redraw_curbuf();
# endif

View File

@@ -181,7 +181,8 @@ static RETSIGTYPE catch_sigpwr __ARGS(SIGPROTOARG);
&& defined(FEAT_TITLE) && !defined(FEAT_GUI_GTK)
# define SET_SIG_ALARM
static RETSIGTYPE sig_alarm __ARGS(SIGPROTOARG);
static int sig_alarm_called;
/* volatile because it is used in signal handler sig_alarm(). */
static volatile int sig_alarm_called;
#endif
static RETSIGTYPE deathtrap __ARGS(SIGPROTOARG);
@@ -201,13 +202,16 @@ static int save_patterns __ARGS((int num_pat, char_u **pat, int *num_file, char_
# define SIG_ERR ((RETSIGTYPE (*)())-1)
#endif
static int do_resize = FALSE;
/* volatile because it is used in signal handler sig_winch(). */
static volatile int do_resize = FALSE;
#ifndef __EMX__
static char_u *extra_shell_arg = NULL;
static int show_shell_mess = TRUE;
#endif
static int deadly_signal = 0; /* The signal we caught */
static int in_mch_delay = FALSE; /* sleeping in mch_delay() */
/* volatile because it is used in signal handler deathtrap(). */
static volatile int deadly_signal = 0; /* The signal we caught */
/* volatile because it is used in signal handler deathtrap(). */
static volatile int in_mch_delay = FALSE; /* sleeping in mch_delay() */
static int curr_tmode = TMODE_COOK; /* contains current terminal mode */
@@ -802,7 +806,7 @@ init_signal_stack()
#endif
/*
* We need correct potatotypes for a signal function, otherwise mean compilers
* We need correct prototypes for a signal function, otherwise mean compilers
* will barf when the second argument to signal() is ``wrong''.
* Let me try it with a few tricky defines from my own osdef.h (jw).
*/
@@ -1068,13 +1072,18 @@ deathtrap SIGDEFARG(sigarg)
SIGRETURN;
}
#ifdef _REENTRANT
#if defined(_REENTRANT) && defined(SIGCONT)
/*
* On Solaris with multi-threading, suspending might not work immediately.
* Catch the SIGCONT signal, which will be used as an indication whether the
* suspending has been done or not.
*
* On Linux, signal is not always handled immediately either.
* See https://bugs.launchpad.net/bugs/291373
*
* volatile because it is used in in signal handler sigcont_handler().
*/
static int sigcont_received;
static volatile int sigcont_received;
static RETSIGTYPE sigcont_handler __ARGS(SIGPROTOARG);
/*
@@ -1118,15 +1127,28 @@ mch_suspend()
}
# endif
# ifdef _REENTRANT
# if defined(_REENTRANT) && defined(SIGCONT)
sigcont_received = FALSE;
# endif
kill(0, SIGTSTP); /* send ourselves a STOP signal */
# ifdef _REENTRANT
/* When we didn't suspend immediately in the kill(), do it now. Happens
* on multi-threaded Solaris. */
if (!sigcont_received)
pause();
# if defined(_REENTRANT) && defined(SIGCONT)
/*
* Wait for the SIGCONT signal to be handled. It generally happens
* immediately, but somehow not all the time. Do not call pause()
* because there would be race condition which would hang Vim if
* signal happened in between the test of sigcont_received and the
* call to pause(). If signal is not yet received, call sleep(0)
* to just yield CPU. Signal should then be received. If somehow
* it's still not received, sleep 1, 2, 3 ms. Don't bother waiting
* further if signal is not received after 1+2+3+4 ms (not expected
* to happen).
*/
{
long wait;
for (wait = 0; !sigcont_received && wait <= 3L; wait++)
/* Loop is not entered most of the time */
mch_delay(wait, FALSE);
}
# endif
# ifdef FEAT_TITLE
@@ -1175,7 +1197,7 @@ set_signals()
#ifdef SIGTSTP
signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
#endif
#ifdef _REENTRANT
#if defined(_REENTRANT) && defined(SIGCONT)
signal(SIGCONT, sigcont_handler);
#endif
@@ -1234,7 +1256,7 @@ catch_int_signal()
reset_signals()
{
catch_signals(SIG_DFL, SIG_DFL);
#ifdef _REENTRANT
#if defined(_REENTRANT) && defined(SIGCONT)
/* SIGCONT isn't in the list, because its default action is ignore */
signal(SIGCONT, SIG_DFL);
#endif
@@ -4092,6 +4114,9 @@ mch_call_shell(cmd, options)
int fromshell_fd;
garray_T ga;
int noread_cnt;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
struct timeval start_tv;
# endif
# ifdef FEAT_GUI
if (pty_master_fd >= 0)
@@ -4201,7 +4226,9 @@ mch_call_shell(cmd, options)
ga_init2(&ga, 1, BUFLEN);
noread_cnt = 0;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
gettimeofday(&start_tv, NULL);
# endif
for (;;)
{
/*
@@ -4214,25 +4241,34 @@ mch_call_shell(cmd, options)
* that a typed password is echoed for ssh or gpg command.
* Don't get characters when the child has already
* finished (wait_pid == 0).
* Don't get extra characters when we already have one.
* Don't read characters unless we didn't get output for a
* while, avoids that ":r !ls" eats typeahead.
* while (noread_cnt > 4), avoids that ":r !ls" eats
* typeahead.
*/
len = 0;
if (!(options & SHELL_EXPAND)
&& ((options &
(SHELL_READ|SHELL_WRITE|SHELL_COOKED))
!= (SHELL_READ|SHELL_WRITE|SHELL_COOKED)
#ifdef FEAT_GUI
# ifdef FEAT_GUI
|| gui.in_use
#endif
# endif
)
&& wait_pid == 0
&& (ta_len > 0
|| (noread_cnt > 4
&& (len = ui_inchar(ta_buf,
BUFLEN, 10L, 0)) > 0)))
&& (ta_len > 0 || noread_cnt > 4))
{
if (ta_len == 0)
{
/* Get extra characters when we don't have any.
* Reset the counter and timer. */
noread_cnt = 0;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
gettimeofday(&start_tv, NULL);
# endif
len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
}
if (ta_len > 0 || len > 0)
{
/*
* For pipes:
* Check for CTRL-C: send interrupt signal to child.
@@ -4334,9 +4370,9 @@ mch_call_shell(cmd, options)
{
ta_len -= len;
mch_memmove(ta_buf, ta_buf + len, ta_len);
noread_cnt = 0;
}
}
}
}
if (got_int)
@@ -4444,6 +4480,25 @@ mch_call_shell(cmd, options)
out_flush();
if (got_int)
break;
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
{
struct timeval now_tv;
long msec;
/* Avoid that we keep looping here without
* checking for a CTRL-C for a long time. Don't
* break out too often to avoid losing typeahead. */
gettimeofday(&now_tv, NULL);
msec = (now_tv.tv_sec - start_tv.tv_sec) * 1000L
+ (now_tv.tv_usec - start_tv.tv_usec) / 1000L;
if (msec > 2000)
{
noread_cnt = 5;
break;
}
}
# endif
}
/* If we already detected the child has finished break the
@@ -5866,7 +5921,9 @@ gpm_open()
* we are going to suspend or starting an external process
* so we shouldn't have problem with this
*/
# ifdef SIGTSTP
signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
# endif
return 1; /* succeed */
}
if (gpm_fd == -2)

View File

@@ -40,6 +40,7 @@ void global_exe __ARGS((char_u *cmd));
int read_viminfo_sub_string __ARGS((vir_T *virp, int force));
void write_viminfo_sub_string __ARGS((FILE *fp));
void free_old_sub __ARGS((void));
void free_signs __ARGS((void));
int prepare_tagpreview __ARGS((int undo_sync));
void ex_help __ARGS((exarg_T *eap));
char_u *check_help_lang __ARGS((char_u *arg));

View File

@@ -4,6 +4,7 @@ char_u *getcmdline_prompt __ARGS((int firstc, char_u *prompt, int attr, int xp_c
int text_locked __ARGS((void));
void text_locked_msg __ARGS((void));
int curbuf_locked __ARGS((void));
int allbuf_locked __ARGS((void));
char_u *getexline __ARGS((int c, void *dummy, int indent));
char_u *getexmodeline __ARGS((int promptc, void *dummy, int indent));
int cmdline_overstrike __ARGS((void));

View File

@@ -1419,6 +1419,7 @@ qf_jump(qi, dir, errornr, forceit)
int opened_window = FALSE;
win_T *win;
win_T *altwin;
int flags;
#endif
win_T *oldwin = curwin;
int print_message = TRUE;
@@ -1531,7 +1532,6 @@ qf_jump(qi, dir, errornr, forceit)
if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0))
{
win_T *wp;
int n;
if (cmdmod.tab != 0)
wp = NULL;
@@ -1547,13 +1547,16 @@ qf_jump(qi, dir, errornr, forceit)
* Split off help window; put it at far top if no position
* specified, the current window is vertically split and narrow.
*/
n = WSP_HELP;
flags = WSP_HELP;
# ifdef FEAT_VERTSPLIT
if (cmdmod.split == 0 && curwin->w_width != Columns
&& curwin->w_width < 80)
n |= WSP_TOP;
flags |= WSP_TOP;
# endif
if (win_split(0, n) == FAIL)
if (qi != &ql_info)
flags |= WSP_NEWLOC; /* don't copy the location list */
if (win_split(0, flags) == FAIL)
goto theend;
opened_window = TRUE; /* close it when fail */
@@ -1563,7 +1566,6 @@ qf_jump(qi, dir, errornr, forceit)
if (qi != &ql_info) /* not a quickfix list */
{
/* The new window should use the supplied location list */
qf_free_all(curwin);
curwin->w_llist = qi;
qi->qf_refcount++;
}
@@ -1610,10 +1612,11 @@ qf_jump(qi, dir, errornr, forceit)
{
goto_tabpage_win(tp, wp);
usable_win = 1;
break;
goto win_found;
}
}
}
win_found:
/*
* If there is only one window and it is the quickfix window, create a
@@ -1623,7 +1626,10 @@ qf_jump(qi, dir, errornr, forceit)
{
ll_ref = curwin->w_llist_ref;
if (win_split(0, WSP_ABOVE) == FAIL)
flags = WSP_ABOVE;
if (ll_ref != NULL)
flags |= WSP_NEWLOC;
if (win_split(0, flags) == FAIL)
goto failed; /* not enough room for window */
opened_window = TRUE; /* close it when fail */
p_swb = empty_option; /* don't split again */
@@ -1635,7 +1641,6 @@ qf_jump(qi, dir, errornr, forceit)
{
/* The new window should use the location list from the
* location list window */
qf_free_all(curwin);
curwin->w_llist = ll_ref;
ll_ref->qf_refcount++;
}
@@ -2310,15 +2315,12 @@ ex_copen(eap)
if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow)
/* Create the new window at the very bottom. */
win_goto(lastwin);
if (win_split(height, WSP_BELOW) == FAIL)
if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL)
return; /* not enough room for window */
#ifdef FEAT_SCROLLBIND
curwin->w_p_scb = FALSE;
#endif
/* Remove the location list for the quickfix window */
qf_free_all(curwin);
if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
{
/*

View File

@@ -6362,7 +6362,7 @@ screen_puts_len(text, len, row, col, attr)
&& c == 0x8e
&& ScreenLines2[off] != ptr[1])
|| (enc_utf8
&& (ScreenLinesUC[off] != (u8char_T)u8c
&& (ScreenLinesUC[off] != (u8char_T)(c >= 0x80 ? u8c : 0)
|| screen_comp_differs(off, u8cc)))
#endif
|| ScreenAttrs[off] != attr
@@ -7368,7 +7368,11 @@ screenalloc(clear)
#endif
static int entered = FALSE; /* avoid recursiveness */
static int done_outofmem_msg = FALSE; /* did outofmem message */
#ifdef FEAT_AUTOCMD
int retry_count = 0;
retry:
#endif
/*
* Allocation of the screen buffers is done only when the size changes and
* when Rows and Columns have been set and we have started doing full
@@ -7452,10 +7456,13 @@ screenalloc(clear)
{
outofmem = TRUE;
#ifdef FEAT_WINDOWS
break;
goto give_up;
#endif
}
}
#ifdef FEAT_WINDOWS
give_up:
#endif
#ifdef FEAT_MBYTE
for (i = 0; i < p_mco; ++i)
@@ -7640,8 +7647,17 @@ screenalloc(clear)
--RedrawingDisabled;
#ifdef FEAT_AUTOCMD
if (starting == 0)
/*
* Do not apply autocommands more than 3 times to avoid an endless loop
* in case applying autocommands always changes Rows or Columns.
*/
if (starting == 0 && ++retry_count <= 3)
{
apply_autocmds(EVENT_VIMRESIZED, NULL, NULL, FALSE, curbuf);
/* In rare cases, autocommands may have altered Rows or Columns,
* jump back to check if we need to allocate the screen again. */
goto retry;
}
#endif
}

View File

@@ -618,7 +618,7 @@ do_tag(tag, type, count, forceit, verbose)
taglen_advance(taglen);
MSG_PUTS_ATTR(_("file\n"), hl_attr(HLF_T));
for (i = 0; i < num_matches; ++i)
for (i = 0; i < num_matches && !got_int; ++i)
{
parse_match(matches[i], &tagp);
if (!new_tag && (
@@ -655,6 +655,8 @@ do_tag(tag, type, count, forceit, verbose)
}
if (msg_col > 0)
msg_putchar('\n');
if (got_int)
break;
msg_advance(15);
/* print any extra fields */
@@ -689,6 +691,8 @@ do_tag(tag, type, count, forceit, verbose)
if (msg_col + ptr2cells(p) >= Columns)
{
msg_putchar('\n');
if (got_int)
break;
msg_advance(15);
}
p = msg_outtrans_one(p, attr);
@@ -704,6 +708,8 @@ do_tag(tag, type, count, forceit, verbose)
if (msg_col > 15)
{
msg_putchar('\n');
if (got_int)
break;
msg_advance(15);
}
}
@@ -734,6 +740,8 @@ do_tag(tag, type, count, forceit, verbose)
{
if (msg_col + (*p == TAB ? 1 : ptr2cells(p)) > Columns)
msg_putchar('\n');
if (got_int)
break;
msg_advance(15);
/* skip backslash used for escaping command char */
@@ -760,12 +768,9 @@ do_tag(tag, type, count, forceit, verbose)
if (msg_col)
msg_putchar('\n');
ui_breakcheck();
if (got_int)
{
got_int = FALSE; /* only stop the listing */
break;
}
}
if (got_int)
got_int = FALSE; /* only stop the listing */
ask_for_selection = TRUE;
}
#if defined(FEAT_QUICKFIX) && defined(FEAT_EVAL)
@@ -2542,6 +2547,15 @@ free_tag_stuff()
{
ga_clear_strings(&tag_fnames);
do_tag(NULL, DT_FREE, 0, 0, 0);
tag_freematch();
# if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
if (ptag_entry.tagname)
{
vim_free(ptag_entry.tagname);
ptag_entry.tagname = NULL;
}
# endif
}
#endif

View File

@@ -676,6 +676,48 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
136,
/**/
135,
/**/
134,
/**/
133,
/**/
132,
/**/
131,
/**/
130,
/**/
129,
/**/
128,
/**/
127,
/**/
126,
/**/
125,
/**/
124,
/**/
123,
/**/
122,
/**/
121,
/**/
120,
/**/
119,
/**/
118,
/**/
117,
/**/
116,
/**/
115,
/**/

View File

@@ -1057,6 +1057,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define WSP_HELP 16 /* creating the help window */
#define WSP_BELOW 32 /* put new window below/right */
#define WSP_ABOVE 64 /* put new window above/left */
#define WSP_NEWLOC 128 /* don't copy location list */
/*
* arguments for gui_set_shellsize()

View File

@@ -12,7 +12,7 @@
static int path_is_url __ARGS((char_u *p));
#if defined(FEAT_WINDOWS) || defined(PROTO)
static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
static void win_init __ARGS((win_T *newp, win_T *oldp));
static void win_init __ARGS((win_T *newp, win_T *oldp, int flags));
static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col));
static void frame_setheight __ARGS((frame_T *curfrp, int height));
#ifdef FEAT_VERTSPLIT
@@ -911,7 +911,7 @@ win_split_ins(size, flags, newwin, dir)
return FAIL;
/* make the contents of the new window the same as the current one */
win_init(wp, curwin);
win_init(wp, curwin, flags);
}
/*
@@ -1160,11 +1160,15 @@ win_split_ins(size, flags, newwin, dir)
* Initialize window "newp" from window "oldp".
* Used when splitting a window and when creating a new tab page.
* The windows will both edit the same buffer.
* WSP_NEWLOC may be specified in flags to prevent the location list from
* being copied.
*/
/*ARGSUSED*/
static void
win_init(newp, oldp)
win_init(newp, oldp, flags)
win_T *newp;
win_T *oldp;
int flags;
{
int i;
@@ -1189,7 +1193,14 @@ win_init(newp, oldp)
copy_jumplist(oldp, newp);
#endif
#ifdef FEAT_QUICKFIX
copy_loclist(oldp, newp);
if (flags & WSP_NEWLOC)
{
/* Don't copy the location list. */
newp->w_llist = NULL;
newp->w_llist_ref = NULL;
}
else
copy_loclist(oldp, newp);
#endif
if (oldp->w_localdir != NULL)
newp->w_localdir = vim_strsave(oldp->w_localdir);
@@ -3219,7 +3230,7 @@ win_alloc_firstwin(oldwin)
else
{
/* First window in new tab page, initialize it from "oldwin". */
win_init(curwin, oldwin);
win_init(curwin, oldwin, 0);
# ifdef FEAT_SCROLLBIND
/* We don't want scroll-binding in the first window. */