forked from aniani/vim
updated for version 7.0009
This commit is contained in:
863
src/auto/configure
vendored
863
src/auto/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -364,6 +364,9 @@ if test "$enable_mzschemeinterp" = "yes"; then
|
||||
dnl Make Vim remember the path to the library. For when it's not in
|
||||
dnl $LD_LIBRARY_PATH.
|
||||
MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
|
||||
elif test "`(uname) 2>/dev/null`" = SunOS &&
|
||||
uname -r | grep '^5' >/dev/null; then
|
||||
MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib"
|
||||
fi
|
||||
fi
|
||||
MZSCHEME_CFLAGS="-I${vi_cv_path_mzscheme_pfx}/include \
|
||||
|
||||
@@ -3205,6 +3205,11 @@ set_one_cmd_context(xp, buff)
|
||||
{
|
||||
xp->xp_context = EXPAND_ENV_VARS;
|
||||
++xp->xp_pattern;
|
||||
#if defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)
|
||||
/* Avoid that the assignment uses EXPAND_FILES again. */
|
||||
if (compl != EXPAND_USER_DEFINED)
|
||||
compl = EXPAND_ENV_VARS;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
30
src/fileio.c
30
src/fileio.c
@@ -2720,6 +2720,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
|
||||
int buf_fname_f = FALSE;
|
||||
int buf_fname_s = FALSE;
|
||||
int did_cmd = FALSE;
|
||||
int nofile_err = FALSE;
|
||||
|
||||
/*
|
||||
* Apply PRE aucocommands.
|
||||
@@ -2742,8 +2743,13 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
|
||||
{
|
||||
if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEAPPENDCMD,
|
||||
sfname, sfname, FALSE, curbuf, eap)))
|
||||
apply_autocmds_exarg(EVENT_FILEAPPENDPRE,
|
||||
{
|
||||
if (bt_nofile(curbuf))
|
||||
nofile_err = TRUE;
|
||||
else
|
||||
apply_autocmds_exarg(EVENT_FILEAPPENDPRE,
|
||||
sfname, sfname, FALSE, curbuf, eap);
|
||||
}
|
||||
}
|
||||
else if (filtering)
|
||||
{
|
||||
@@ -2754,15 +2760,25 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
|
||||
{
|
||||
if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
|
||||
sfname, sfname, FALSE, curbuf, eap)))
|
||||
apply_autocmds_exarg(EVENT_BUFWRITEPRE,
|
||||
{
|
||||
if (bt_nofile(curbuf))
|
||||
nofile_err = TRUE;
|
||||
else
|
||||
apply_autocmds_exarg(EVENT_BUFWRITEPRE,
|
||||
sfname, sfname, FALSE, curbuf, eap);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEWRITECMD,
|
||||
sfname, sfname, FALSE, curbuf, eap)))
|
||||
apply_autocmds_exarg(EVENT_FILEWRITEPRE,
|
||||
{
|
||||
if (bt_nofile(curbuf))
|
||||
nofile_err = TRUE;
|
||||
else
|
||||
apply_autocmds_exarg(EVENT_FILEWRITEPRE,
|
||||
sfname, sfname, FALSE, curbuf, eap);
|
||||
}
|
||||
}
|
||||
|
||||
/* restore curwin/curbuf and a few other things */
|
||||
@@ -2776,11 +2792,15 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
|
||||
*/
|
||||
if (!buf_valid(buf))
|
||||
buf = NULL;
|
||||
if (buf == NULL || buf->b_ml.ml_mfp == NULL || did_cmd || aborting())
|
||||
if (buf == NULL || buf->b_ml.ml_mfp == NULL
|
||||
|| did_cmd || nofile_err || aborting())
|
||||
{
|
||||
--no_wait_return;
|
||||
msg_scroll = msg_save;
|
||||
if (aborting())
|
||||
if (nofile_err)
|
||||
EMSG(_("E676: No matching autocommands for acwrite buffer"));
|
||||
|
||||
if (aborting() || nofile_err)
|
||||
/* An aborting error, interrupt or exception in the
|
||||
* autocommands. */
|
||||
return FAIL;
|
||||
|
||||
105
src/misc1.c
105
src/misc1.c
@@ -992,24 +992,92 @@ open_line(dir, flags, old_indent)
|
||||
for (p = leader + lead_len - 1; p > leader
|
||||
&& vim_iswhite(*p); --p)
|
||||
;
|
||||
|
||||
++p;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/* Compute the length of the replaced characters in
|
||||
* screen characters, not bytes. */
|
||||
{
|
||||
int repl_size = vim_strnsize(lead_repl,
|
||||
lead_repl_len);
|
||||
int old_size = 0;
|
||||
char_u *endp = p;
|
||||
int l;
|
||||
|
||||
while (old_size < repl_size && p > leader)
|
||||
{
|
||||
--p;
|
||||
p -= mb_head_off(leader, p);
|
||||
old_size += ptr2cells(p);
|
||||
}
|
||||
l = lead_repl_len - (endp - p);
|
||||
if (l != 0)
|
||||
mch_memmove(endp + l, endp,
|
||||
(size_t)((leader + lead_len) - endp));
|
||||
lead_len += l;
|
||||
}
|
||||
#else
|
||||
if (p < leader + lead_repl_len)
|
||||
p = leader;
|
||||
else
|
||||
p -= lead_repl_len;
|
||||
#endif
|
||||
mch_memmove(p, lead_repl, (size_t)lead_repl_len);
|
||||
if (p + lead_repl_len > leader + lead_len)
|
||||
p[lead_repl_len] = NUL;
|
||||
|
||||
/* blank-out any other chars from the old leader. */
|
||||
while (--p >= leader)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
int l = mb_head_off(leader, p);
|
||||
|
||||
if (l > 1)
|
||||
{
|
||||
p -= l;
|
||||
if (ptr2cells(p) > 1)
|
||||
{
|
||||
p[1] = ' ';
|
||||
--l;
|
||||
}
|
||||
mch_memmove(p + 1, p + l + 1,
|
||||
(size_t)((leader + lead_len) - (p + l + 1)));
|
||||
lead_len -= l;
|
||||
*p = ' ';
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (!vim_iswhite(*p))
|
||||
*p = ' ';
|
||||
}
|
||||
}
|
||||
else /* left adjusted leader */
|
||||
{
|
||||
p = skipwhite(leader);
|
||||
#ifdef FEAT_MBYTE
|
||||
/* Compute the length of the replaced characters in
|
||||
* screen characters, not bytes. Move the part that is
|
||||
* not to be overwritten. */
|
||||
{
|
||||
int repl_size = vim_strnsize(lead_repl,
|
||||
lead_repl_len);
|
||||
int i;
|
||||
int l;
|
||||
|
||||
for (i = 0; p[i] != NUL && i < lead_len; i += l)
|
||||
{
|
||||
l = mb_ptr2len_check(p + i);
|
||||
if (vim_strnsize(p, i + l) > repl_size)
|
||||
break;
|
||||
}
|
||||
if (i != lead_repl_len)
|
||||
{
|
||||
mch_memmove(p + lead_repl_len, p + i,
|
||||
(size_t)(lead_len - i - (leader - p)));
|
||||
lead_len += lead_repl_len - i;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mch_memmove(p, lead_repl, (size_t)lead_repl_len);
|
||||
|
||||
/* Replace any remaining non-white chars in the old
|
||||
@@ -1026,7 +1094,26 @@ open_line(dir, flags, old_indent)
|
||||
(leader + lead_len) - p);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
int l = mb_ptr2len_check(p);
|
||||
|
||||
if (l > 1)
|
||||
{
|
||||
if (ptr2cells(p) > 1)
|
||||
{
|
||||
/* Replace a double-wide char with
|
||||
* two spaces */
|
||||
--l;
|
||||
*p++ = ' ';
|
||||
}
|
||||
mch_memmove(p + 1, p + l,
|
||||
(leader + lead_len) - p);
|
||||
lead_len -= l - 1;
|
||||
}
|
||||
#endif
|
||||
*p = ' ';
|
||||
}
|
||||
}
|
||||
*p = NUL;
|
||||
}
|
||||
@@ -3789,7 +3876,8 @@ get_env_name(xp, idx)
|
||||
/* Borland C++ 5.2 has this in a header file. */
|
||||
extern char **environ;
|
||||
# endif
|
||||
static char_u name[100];
|
||||
# define ENVNAMELEN 100
|
||||
static char_u name[ENVNAMELEN];
|
||||
char_u *str;
|
||||
int n;
|
||||
|
||||
@@ -3797,7 +3885,7 @@ get_env_name(xp, idx)
|
||||
if (str == NULL)
|
||||
return NULL;
|
||||
|
||||
for (n = 0; n < 99; ++n)
|
||||
for (n = 0; n < ENVNAMELEN - 1; ++n)
|
||||
{
|
||||
if (str[n] == '=' || str[n] == NUL)
|
||||
break;
|
||||
@@ -5064,7 +5152,10 @@ cin_is_cpp_baseclass(line, col)
|
||||
|
||||
*col = 0;
|
||||
|
||||
s = cin_skipcomment(line);
|
||||
s = skipwhite(line);
|
||||
if (*s == '#') /* skip #define FOO x ? (x) : x */
|
||||
return FALSE;
|
||||
s = cin_skipcomment(s);
|
||||
if (*s == NUL)
|
||||
return FALSE;
|
||||
|
||||
@@ -5737,7 +5828,8 @@ get_c_indent()
|
||||
if (start_off != 0)
|
||||
amount += start_off;
|
||||
else if (start_align == COM_RIGHT)
|
||||
amount += lead_start_len - lead_middle_len;
|
||||
amount += vim_strsize(lead_start)
|
||||
- vim_strsize(lead_middle);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5751,7 +5843,8 @@ get_c_indent()
|
||||
if (off != 0)
|
||||
amount += off;
|
||||
else if (align == COM_RIGHT)
|
||||
amount += lead_start_len - lead_middle_len;
|
||||
amount += vim_strsize(lead_start)
|
||||
- vim_strsize(lead_middle);
|
||||
done = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2475,7 +2475,11 @@ static char *(p_debug_values[]) = {"msg", NULL};
|
||||
static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
|
||||
#endif
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
# ifdef FEAT_AUTOCMD
|
||||
static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "acwrite", NULL};
|
||||
# else
|
||||
static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", NULL};
|
||||
# endif
|
||||
static char *(p_bufhidden_values[]) = {"hide", "unload", "delete", "wipe", NULL};
|
||||
#endif
|
||||
static char *(p_bs_values[]) = {"indent", "eol", "start", NULL};
|
||||
|
||||
@@ -1972,13 +1972,15 @@ bt_quickfix(buf)
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "buf" is a "nofile" buffer.
|
||||
* Return TRUE if "buf" is a "nofile" or "acwrite" buffer.
|
||||
* This means the buffer name is not a file name.
|
||||
*/
|
||||
int
|
||||
bt_nofile(buf)
|
||||
buf_T *buf;
|
||||
{
|
||||
return (buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f');
|
||||
return (buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
|
||||
|| buf->b_p_bt[0] == 'a';
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user