Compare commits

...

18 Commits

Author SHA1 Message Date
Bram Moolenaar
8df74be587 updated for version 7.2-048 2008-11-20 15:12:02 +00:00
Bram Moolenaar
0300597f4c updated for version 7.2-047 2008-11-20 13:12:36 +00:00
Bram Moolenaar
3025b39e97 updated for version 7.2-046 2008-11-20 10:56:33 +00:00
Bram Moolenaar
9774ecc80c updated for version 7.2-045 2008-11-20 10:04:53 +00:00
Bram Moolenaar
0cd49305c4 updated for version 7.2-044 2008-11-20 09:37:01 +00:00
Bram Moolenaar
03cd93a576 updated for version 7.2-043 2008-11-20 09:27:32 +00:00
Bram Moolenaar
bf9065c925 fix truncation 2008-11-15 15:16:46 +00:00
Bram Moolenaar
d4153d4a62 updated for version 7.2-042 2008-11-15 15:06:17 +00:00
Bram Moolenaar
701f7afcdf updated for version 7.2-041 2008-11-15 13:12:07 +00:00
Bram Moolenaar
1c8603613a updated for version 7.2-040 2008-11-12 15:05:21 +00:00
Bram Moolenaar
0f71c6d020 updated for version 7.2-039 2008-11-12 14:29:28 +00:00
Bram Moolenaar
fbc0cfad0c updated for version 7.2-038 2008-11-12 13:52:46 +00:00
Bram Moolenaar
a878510770 updated for version 7.2-037 2008-11-12 13:10:15 +00:00
Bram Moolenaar
12806c8844 updated for version 7.2-036 2008-11-12 12:36:30 +00:00
Bram Moolenaar
5a22181f59 updated for version 7.2-035 2008-11-12 12:08:45 +00:00
Bram Moolenaar
9381ab7761 updated for version 7.2-034 2008-11-12 11:52:19 +00:00
Bram Moolenaar
223a18948c updated for version 7.2-033 2008-11-11 20:57:11 +00:00
Bram Moolenaar
121932191b updated for version 7.2-032 2008-11-09 16:22:01 +00:00
35 changed files with 298 additions and 106 deletions

26
src/auto/configure vendored
View File

@@ -16819,21 +16819,29 @@ if test "x$MACARCH" = "xboth"; then
LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
fi
{ $as_echo "$as_me:$LINENO: checking for GCC 3 or later" >&5
$as_echo_n "checking for GCC 3 or later... " >&6; }
DEPEND_CFLAGS_FILTER=
if test "$GCC" = yes; then
{ $as_echo "$as_me:$LINENO: checking for GCC 3 or later" >&5
$as_echo_n "checking for GCC 3 or later... " >&6; }
gccmajor=`echo "$gccversion" | sed -e 's/^\([1-9]\)\..*$/\1/g'`
if test "$gccmajor" -gt "2"; then
DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
fi
fi
if test "$DEPEND_CFLAGS_FILTER" = ""; then
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: yes" >&5
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5
$as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; }
if test "$gccmajor" -gt "3"; then
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1"
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
fi

View File

@@ -33,7 +33,7 @@ static char_u *buflist_match __ARGS((regprog_T *prog, buf_T *buf));
static char_u *fname_match __ARGS((regprog_T *prog, char_u *name));
#endif
static void buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
static wininfo_T *find_wininfo __ARGS((buf_T *buf));
static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
#ifdef UNIX
static buf_T *buflist_findname_stat __ARGS((char_u *ffname, struct stat *st));
static int otherfile_buf __ARGS((buf_T *buf, char_u *ffname, struct stat *stp));
@@ -647,6 +647,9 @@ free_buffer_stuff(buf, free_options)
vim_free(buf->b_start_fenc);
buf->b_start_fenc = NULL;
#endif
#ifdef FEAT_SPELL
ga_clear(&buf->b_langp);
#endif
}
/*
@@ -1090,7 +1093,7 @@ do_buffer(action, start, dir, count, forceit)
#endif
setpcmark();
retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
forceit ? ECMD_FORCEIT : 0);
forceit ? ECMD_FORCEIT : 0, curwin);
/*
* do_ecmd() may create a new buffer, then we have to delete
@@ -1237,7 +1240,7 @@ do_buffer(action, start, dir, count, forceit)
* "buf" if one exists */
if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf))
return OK;
/* If 'switchbuf' contians "usetab": jump to first window in any tab
/* If 'switchbuf' contains "usetab": jump to first window in any tab
* page containing "buf" if one exists */
if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf))
return OK;
@@ -1313,7 +1316,7 @@ set_curbuf(buf, action)
setpcmark();
if (!cmdmod.keepalt)
curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */
buflist_altfpos(); /* remember curpos */
buflist_altfpos(curwin); /* remember curpos */
#ifdef FEAT_VISUAL
/* Don't restart Select mode after switching to another buffer. */
@@ -1398,6 +1401,9 @@ enter_buffer(buf)
curwin->w_cursor.coladd = 0;
#endif
curwin->w_set_curswant = TRUE;
#ifdef FEAT_AUTOCMD
curwin->w_topline_was_set = FALSE;
#endif
/* Make sure the buffer is loaded. */
if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
@@ -1437,7 +1443,8 @@ enter_buffer(buf)
maketitle();
#endif
#ifdef FEAT_AUTOCMD
if (curwin->w_topline == 1) /* when autocmds didn't change it */
/* when autocmds didn't change it */
if (curwin->w_topline == 1 && !curwin->w_topline_was_set)
#endif
scroll_cursor_halfway(FALSE); /* redisplay at correct position */
@@ -2401,22 +2408,70 @@ buflist_setfpos(buf, win, lnum, col, copy_options)
return;
}
#ifdef FEAT_DIFF
static int wininfo_other_tab_diff __ARGS((wininfo_T *wip));
/*
* Return TRUE when "wip" has 'diff' set and the diff is only for another tab
* page. That's because a diff is local to a tab page.
*/
static int
wininfo_other_tab_diff(wip)
wininfo_T *wip;
{
win_T *wp;
if (wip->wi_opt.wo_diff)
{
for (wp = firstwin; wp != NULL; wp = wp->w_next)
/* return FALSE when it's a window in the current tab page, thus
* the buffer was in diff mode here */
if (wip->wi_win == wp)
return FALSE;
return TRUE;
}
return FALSE;
}
#endif
/*
* Find info for the current window in buffer "buf".
* If not found, return the info for the most recently used window.
* When "skip_diff_buffer" is TRUE avoid windows with 'diff' set that is in
* another tab page.
* Returns NULL when there isn't any info.
*/
/*ARGSUSED*/
static wininfo_T *
find_wininfo(buf)
find_wininfo(buf, skip_diff_buffer)
buf_T *buf;
int skip_diff_buffer;
{
wininfo_T *wip;
for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
if (wip->wi_win == curwin)
if (wip->wi_win == curwin
#ifdef FEAT_DIFF
&& (!skip_diff_buffer || !wininfo_other_tab_diff(wip))
#endif
)
break;
if (wip == NULL) /* if no fpos for curwin, use the first in the list */
wip = buf->b_wininfo;
/* If no wininfo for curwin, use the first in the list (that doesn't have
* 'diff' set and is in another tab page). */
if (wip == NULL)
{
#ifdef FEAT_DIFF
if (skip_diff_buffer)
{
for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
if (!wininfo_other_tab_diff(wip))
break;
}
else
#endif
wip = buf->b_wininfo;
}
return wip;
}
@@ -2437,7 +2492,7 @@ get_winopts(buf)
clearFolding(curwin);
#endif
wip = find_wininfo(buf);
wip = find_wininfo(buf, TRUE);
if (wip != NULL && wip->wi_optset)
{
copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt);
@@ -2469,7 +2524,7 @@ buflist_findfpos(buf)
wininfo_T *wip;
static pos_T no_position = {1, 0};
wip = find_wininfo(buf);
wip = find_wininfo(buf, FALSE);
if (wip != NULL)
return &(wip->wi_fpos);
else
@@ -2790,14 +2845,14 @@ buflist_slash_adjust()
#endif
/*
* Set alternate cursor position for current window.
* Set alternate cursor position for the current buffer and window "win".
* Also save the local window option values.
*/
void
buflist_altfpos()
buflist_altfpos(win)
win_T *win;
{
buflist_setfpos(curbuf, curwin, curwin->w_cursor.lnum,
curwin->w_cursor.col, TRUE);
buflist_setfpos(curbuf, win, win->w_cursor.lnum, win->w_cursor.col, TRUE);
}
/*
@@ -3964,7 +4019,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t
width = vim_strsize(out);
if (maxwidth > 0 && width > maxwidth)
{
/* Result is too long, must trunctate somewhere. */
/* Result is too long, must truncate somewhere. */
l = 0;
if (itemcnt == 0)
s = out;
@@ -4489,7 +4544,7 @@ do_arg_all(count, forceit, keep_tabs)
ECMD_ONE,
((P_HID(curwin->w_buffer)
|| bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
+ ECMD_OLDBUF);
+ ECMD_OLDBUF, curwin);
#ifdef FEAT_AUTOCMD
if (use_firstwin)
++autocmd_no_leave;

View File

@@ -3152,18 +3152,25 @@ dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
dnl But only when making dependencies, cproto and lint don't take "-isystem".
dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
dnl the number before the version number.
AC_MSG_CHECKING(for GCC 3 or later)
DEPEND_CFLAGS_FILTER=
if test "$GCC" = yes; then
AC_MSG_CHECKING(for GCC 3 or later)
gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
if test "$gccmajor" -gt "2"; then
DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is
dnl declared as char x[1] but actually longer. Introduced in gcc 4.0.
AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
if test "$gccmajor" -gt "3"; then
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
if test "$DEPEND_CFLAGS_FILTER" = ""; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
AC_SUBST(DEPEND_CFLAGS_FILTER)

View File

@@ -846,8 +846,8 @@ eval_clear()
p = &vimvars[i];
if (p->vv_di.di_tv.v_type == VAR_STRING)
{
vim_free(p->vv_string);
p->vv_string = NULL;
vim_free(p->vv_str);
p->vv_str = NULL;
}
else if (p->vv_di.di_tv.v_type == VAR_LIST)
{
@@ -856,6 +856,7 @@ eval_clear()
}
}
hash_clear(&vimvarht);
hash_init(&vimvarht); /* garbage_collect() will access it */
hash_clear(&compat_hashtab);
/* script-local variables */
@@ -18145,14 +18146,17 @@ get_vim_var_list(idx)
}
/*
* Set v:count, v:count1 and v:prevcount.
* Set v:count to "count" and v:count1 to "count1".
* When "set_prevcount" is TRUE first set v:prevcount from v:count.
*/
void
set_vcount(count, count1)
set_vcount(count, count1, set_prevcount)
long count;
long count1;
int set_prevcount;
{
vimvars[VV_PREVCOUNT].vv_nr = vimvars[VV_COUNT].vv_nr;
if (set_prevcount)
vimvars[VV_PREVCOUNT].vv_nr = vimvars[VV_COUNT].vv_nr;
vimvars[VV_COUNT].vv_nr = count;
vimvars[VV_COUNT1].vv_nr = count1;
}
@@ -21149,8 +21153,11 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
init_var_dict(&fc.l_avars, &fc.l_avars_var);
add_nr_var(&fc.l_avars, &fc.fixvar[fixvar_idx++].var, "0",
(varnumber_T)(argcount - fp->uf_args.ga_len));
/* Use "name" to avoid a warning from some compiler that checks the
* destination size. */
v = &fc.fixvar[fixvar_idx++].var;
STRCPY(v->di_key, "000");
name = v->di_key;
STRCPY(name, "000");
v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
hash_add(&fc.l_avars.dv_hashtab, DI2HIKEY(v));
v->di_tv.v_type = VAR_LIST;

View File

@@ -3052,7 +3052,8 @@ getfile(fnum, ffname, sfname, setpm, lnum, forceit)
retval = 0; /* it's in the same file */
}
else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0)) == OK)
(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
curwin) == OK)
retval = -1; /* opened another file */
else
retval = 1; /* error encountered */
@@ -3085,17 +3086,21 @@ theend:
* ECMD_OLDBUF: use existing buffer if it exists
* ECMD_FORCEIT: ! used for Ex command
* ECMD_ADDBUF: don't edit, just add to buffer list
* oldwin: Should be "curwin" when editing a new buffer in the current
* window, NULL when splitting the window first. When not NULL info
* of the previous buffer for "oldwin" is stored.
*
* return FAIL for failure, OK otherwise
*/
int
do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
int fnum;
char_u *ffname;
char_u *sfname;
exarg_T *eap; /* can be NULL! */
linenr_T newlnum;
int flags;
win_T *oldwin;
{
int other_file; /* TRUE if editing another file */
int oldbuf; /* TRUE if using existing buffer */
@@ -3267,7 +3272,8 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
{
if (!cmdmod.keepalt)
curwin->w_alt_fnum = curbuf->b_fnum;
buflist_altfpos();
if (oldwin != NULL)
buflist_altfpos(oldwin);
}
if (fnum)
@@ -3371,7 +3377,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
/* close the link to the current buffer */
u_sync(FALSE);
close_buffer(curwin, curbuf,
close_buffer(oldwin, curbuf,
(flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
#ifdef FEAT_AUTOCMD
@@ -5609,7 +5615,13 @@ ex_help(eap)
*/
alt_fnum = curbuf->b_fnum;
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
ECMD_HIDE + ECMD_SET_HELP);
ECMD_HIDE + ECMD_SET_HELP,
#ifdef FEAT_WINDOWS
NULL /* buffer is still open, don't store info */
#else
curwin
#endif
);
if (!cmdmod.keepalt)
curwin->w_alt_fnum = alt_fnum;
empty_fnum = curbuf->b_fnum;

View File

@@ -2132,8 +2132,8 @@ do_argfile(eap, argn)
* argument index. */
if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
eap, ECMD_LAST,
(P_HID(curwin->w_buffer) ? ECMD_HIDE : 0) +
(eap->forceit ? ECMD_FORCEIT : 0)) == FAIL)
(P_HID(curwin->w_buffer) ? ECMD_HIDE : 0)
+ (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL)
curwin->w_arg_idx = old_arg_idx;
/* like Vi: set the mark where the cursor is in the file. */
else if (eap->cmdidx != CMD_argdo)

View File

@@ -7488,7 +7488,8 @@ do_exedit(eap, old_curwin)
/* ":new" or ":tabnew" without argument: edit an new empty buffer */
setpcmark();
(void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0));
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
old_curwin == NULL ? curwin : NULL);
}
else if ((eap->cmdidx != CMD_split
#ifdef FEAT_VERTSPLIT
@@ -7525,7 +7526,7 @@ do_exedit(eap, old_curwin)
#ifdef FEAT_LISTCMDS
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
#endif
) == FAIL)
, old_curwin == NULL ? curwin : NULL) == FAIL)
{
/* Editing the file failed. If the window was split, close it. */
#ifdef FEAT_WINDOWS

View File

@@ -6051,7 +6051,7 @@ ex_window()
cmdwin_type = '-';
/* Create the command-line buffer empty. */
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);

View File

@@ -932,7 +932,10 @@ retry:
else
{
if (eap != NULL && eap->force_ff != 0)
{
fileformat = get_fileformat_force(curbuf, eap);
try_unix = try_dos = try_mac = FALSE;
}
else if (curbuf->b_p_bin)
fileformat = EOL_UNIX; /* binary: use Unix format */
else if (*p_ffs == NUL)
@@ -2341,11 +2344,6 @@ failed:
STRCAT(IObuff, _("[CR missing]"));
c = TRUE;
}
if (ff_error == EOL_MAC)
{
STRCAT(IObuff, _("[NL found]"));
c = TRUE;
}
if (split)
{
STRCAT(IObuff, _("[long lines split]"));
@@ -5550,9 +5548,10 @@ check_for_bom(p, size, lenp, flags)
name = "ucs-4le"; /* FF FE 00 00 */
len = 4;
}
else if (flags == FIO_ALL || flags == (FIO_UCS2 | FIO_ENDIAN_L))
else if (flags == (FIO_UCS2 | FIO_ENDIAN_L))
name = "ucs-2le"; /* FF FE */
else if (flags == (FIO_UTF16 | FIO_ENDIAN_L))
else if (flags == FIO_ALL || flags == (FIO_UTF16 | FIO_ENDIAN_L))
/* utf-16le is preferred, it also works for ucs-2le text */
name = "utf-16le"; /* FF FE */
}
else if (p[0] == 0xfe && p[1] == 0xff

View File

@@ -695,7 +695,7 @@ gui_mch_set_winpos(int x, int y)
gui_mch_set_shellsize(width, height, min_width, min_height, base_width, base_height, direction)
int width; /* In OS units */
int height;
int min_width; /* Smallest permissable window size (ignored) */
int min_width; /* Smallest permissible window size (ignored) */
int min_height;
int base_width; /* Space for scroll bars, etc */
int base_height;
@@ -863,7 +863,7 @@ zap_load_file(name, style)
if (strncmp(file, "ZapFont\015", 8) == 0)
return file; /* Loaded OK! */
free(file);
vim_free(file);
return NULL; /* Not a valid font file */
}

View File

@@ -3335,7 +3335,7 @@ gui_mch_browseW(
/*
* Convert the string s to the proper format for a filter string by replacing
* the \t and \n delimeters with \0.
* the \t and \n delimiters with \0.
* Returns the converted string in allocated memory.
*
* Keep in sync with convert_filterW() above!
@@ -3674,7 +3674,8 @@ _OnScroll(
* Use "prog" as the name of the program and "cmdline" as the arguments.
* Copy the arguments to allocated memory.
* Return the number of arguments (including program name).
* Return pointers to the arguments in "argvp".
* Return pointers to the arguments in "argvp". Memory is allocated with
* malloc(), use free() instead of vim_free().
* Return pointer to buffer in "tofree".
* Returns zero when out of memory.
*/
@@ -3692,6 +3693,8 @@ get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree)
char **argv = NULL;
int round;
*tofree = NULL;
#ifdef FEAT_MBYTE
/* Try using the Unicode version first, it takes care of conversion when
* 'encoding' is changed. */
@@ -3802,15 +3805,15 @@ get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree)
argv = (char **)malloc((argc + 1) * sizeof(char *));
if (argv == NULL )
{
vim_free(newcmdline);
free(newcmdline);
return 0; /* malloc error */
}
pnew = newcmdline;
*tofree = newcmdline;
}
}
done:
argv[argc] = NULL; /* NULL-terminated list */
*argvp = argv;
return argc;

View File

@@ -2450,7 +2450,7 @@ find_closest_color(colormap, colorPtr)
*colorPtr = colortable[closest];
}
free(colortable);
vim_free(colortable);
return OK;
}

View File

@@ -531,6 +531,12 @@ Python_Init(void)
if (PythonMod_Init())
goto fail;
/* Remove the element from sys.path that was added because of our
* argv[0] value in PythonMod_Init(). Previously we used an empty
* string, but dependinding on the OS we then get an empty entry or
* the current directory in sys.path. */
PyRun_SimpleString("import sys; sys.path = filter(lambda x: x != '/must>not&exist', sys.path)");
/* the first python thread is vim's, release the lock */
Python_SaveThread();
@@ -2345,7 +2351,8 @@ PythonMod_Init(void)
{
PyObject *mod;
PyObject *dict;
static char *(argv[2]) = {"", NULL};
/* The special value is removed from sys.path in Python_Init(). */
static char *(argv[2]) = {"/must>not&exist/foo", NULL};
/* Fixups... */
BufferType.ob_type = &PyType_Type;

View File

@@ -1114,7 +1114,8 @@ vi_open_file(fname)
char *fname;
{
++no_wait_return;
do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF);
do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF,
curwin);
curbuf->b_sniff = TRUE;
--no_wait_return; /* [ex_docmd.c] */
}

View File

@@ -736,7 +736,7 @@ ServerReplyFind(w, op)
+ serverReply.ga_len;
e.id = w;
ga_init2(&e.strings, 1, 100);
memcpy(p, &e, sizeof(e));
mch_memmove(p, &e, sizeof(e));
serverReply.ga_len++;
}
}
@@ -1018,7 +1018,7 @@ LookupName(dpy, name, delete, loose)
p++;
count = numItems - (p - regProp);
if (count > 0)
memcpy(entry, p, count);
mch_memmove(entry, p, count);
XChangeProperty(dpy, RootWindow(dpy, 0), registryProperty, XA_STRING,
8, PropModeReplace, regProp,
(int)(numItems - (p - entry)));
@@ -1072,7 +1072,7 @@ DeleteAnyLingerer(dpy, win)
p++;
lastHalf = numItems - (p - regProp);
if (lastHalf > 0)
memcpy(entry, p, lastHalf);
mch_memmove(entry, p, lastHalf);
numItems = (entry - regProp) + lastHalf;
p = entry;
continue;

View File

@@ -1510,7 +1510,8 @@ parse_command_name(parmp)
early_arg_scan(parmp)
mparm_T *parmp;
{
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER)
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER) \
|| !defined(FEAT_NETBEANS_INTG)
int argc = parmp->argc;
char **argv = parmp->argv;
int i;
@@ -1582,6 +1583,14 @@ early_arg_scan(parmp)
else if (STRICMP(argv[i], "--echo-wid") == 0)
echo_wid_arg = TRUE;
# endif
# ifndef FEAT_NETBEANS_INTG
else if (strncmp(argv[i], "-nb", (size_t)3) == 0)
{
mch_errmsg(_("'-nb' cannot be used: not enabled at compile time\n"));
mch_exit(2);
}
# endif
}
#endif
}
@@ -2588,7 +2597,7 @@ edit_buffers(parmp)
# endif
(void)do_ecmd(0, arg_idx < GARGCOUNT
? alist_name(&GARGLIST[arg_idx]) : NULL,
NULL, NULL, ECMD_LASTL, ECMD_HIDE);
NULL, NULL, ECMD_LASTL, ECMD_HIDE, curwin);
# ifdef HAS_SWAP_EXISTS_ACTION
if (swap_exists_did_quit)
{

View File

@@ -3131,7 +3131,7 @@ enc_locale()
else
s = p + 1;
}
for (i = 0; s[i] != NUL && s + i < buf + sizeof(buf) - 1; ++i)
for (i = 0; s[i] != NUL && i < sizeof(buf) - 1; ++i)
{
if (s[i] == '_' || s[i] == '-')
buf[i] = '-';
@@ -5384,7 +5384,7 @@ preedit_draw_cbproc(XIC xic, XPointer client_data, XPointer call_data)
draw_feedback = (char *)alloc(draw_data->chg_first
+ text->length);
else
draw_feedback = realloc(draw_feedback,
draw_feedback = vim_realloc(draw_feedback,
draw_data->chg_first + text->length);
if (draw_feedback != NULL)
{

View File

@@ -873,7 +873,7 @@ lalloc(size, message)
/* 3. check for available memory: call mch_avail_mem() */
if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
{
vim_free((char *)p); /* System is low... no go! */
free((char *)p); /* System is low... no go! */
p = NULL;
}
else

View File

@@ -280,18 +280,20 @@ update_topline()
if (curwin->w_botline <= curbuf->b_ml.ml_line_count)
{
if (curwin->w_cursor.lnum < curwin->w_botline
&& ((long)curwin->w_cursor.lnum
if (curwin->w_cursor.lnum < curwin->w_botline)
{
if (((long)curwin->w_cursor.lnum
>= (long)curwin->w_botline - p_so
#ifdef FEAT_FOLDING
|| hasAnyFolding(curwin)
#endif
))
{
{
lineoff_T loff;
/* Cursor is above botline, check if there are 'scrolloff'
* window lines below the cursor. If not, need to scroll. */
/* Cursor is (a few lines) above botline, check if there are
* 'scrolloff' window lines below the cursor. If not, need to
* scroll. */
n = curwin->w_empty_rows;
loff.lnum = curwin->w_cursor.lnum;
#ifdef FEAT_FOLDING
@@ -317,6 +319,10 @@ update_topline()
if (n >= p_so)
/* sufficient context, no need to scroll */
check_botline = FALSE;
}
else
/* sufficient context, no need to scroll */
check_botline = FALSE;
}
if (check_botline)
{
@@ -509,6 +515,9 @@ set_topline(wp, lnum)
/* Approximate the value of w_botline */
wp->w_botline += lnum - wp->w_topline;
wp->w_topline = lnum;
#ifdef FEAT_AUTOCMD
wp->w_topline_was_set = TRUE;
#endif
#ifdef FEAT_DIFF
wp->w_topfill = 0;
#endif

View File

@@ -1795,7 +1795,7 @@ nb_do_cmd(
buf->displayname = NULL;
netbeansReadFile = 0; /* don't try to open disk file */
do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF);
do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF, curwin);
netbeansReadFile = 1;
buf->bufp = curbuf;
maketitle();
@@ -1960,7 +1960,7 @@ nb_do_cmd(
netbeansReadFile = 0; /* don't try to open disk file */
do_ecmd(0, (char_u *)buf->displayname, 0, 0, ECMD_ONE,
ECMD_HIDE + ECMD_OLDBUF);
ECMD_HIDE + ECMD_OLDBUF, curwin);
netbeansReadFile = 1;
buf->bufp = curbuf;
maketitle();
@@ -1979,7 +1979,7 @@ nb_do_cmd(
vim_free(buf->displayname);
buf->displayname = nb_unquote(args, NULL);
do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
ECMD_HIDE + ECMD_OLDBUF);
ECMD_HIDE + ECMD_OLDBUF, curwin);
buf->bufp = curbuf;
buf->initDone = TRUE;
doupdate = 1;

View File

@@ -580,6 +580,9 @@ normal_cmd(oap, toplevel)
static int old_mapped_len = 0;
#endif
int idx;
#ifdef FEAT_EVAL
int set_prevcount = FALSE;
#endif
vim_memset(&ca, 0, sizeof(ca)); /* also resets ca.retval */
ca.oap = oap;
@@ -615,7 +618,12 @@ normal_cmd(oap, toplevel)
/* When not finishing an operator and no register name typed, reset the
* count. */
if (!finish_op && !oap->regname)
{
ca.opcount = 0;
#ifdef FEAT_EVAL
set_prevcount = TRUE;
#endif
}
#ifdef FEAT_AUTOCMD
/* Restore counts from before receiving K_CURSORHOLD. This means after
@@ -719,7 +727,15 @@ getcount:
* command, so that v:count can be used in an expression mapping
* right after the count. */
if (toplevel && stuff_empty())
set_vcount(ca.count0, ca.count0 == 0 ? 1 : ca.count0);
{
long count = ca.count0;
/* multiply with ca.opcount the same way as below */
if (ca.opcount != 0)
count = ca.opcount * (count == 0 ? 1 : count);
set_vcount(count, count == 0 ? 1 : count, set_prevcount);
set_prevcount = FALSE; /* only set v:prevcount once */
}
#endif
if (ctrl_w)
{
@@ -806,7 +822,7 @@ getcount:
* Only set v:count when called from main() and not a stuffed command.
*/
if (toplevel && stuff_empty())
set_vcount(ca.count0, ca.count1);
set_vcount(ca.count0, ca.count1, set_prevcount);
#endif
/*
@@ -6050,7 +6066,7 @@ nv_gotofile(cap)
autowrite(curbuf, FALSE);
setpcmark();
(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
P_HID(curbuf) ? ECMD_HIDE : 0);
P_HID(curbuf) ? ECMD_HIDE : 0, curwin);
if (cap->nchar == 'F' && lnum >= 0)
{
curwin->w_cursor.lnum = lnum;

View File

@@ -2905,7 +2905,7 @@ mch_early_init()
* Ignore any errors.
*/
#if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
signal_stack = malloc(SIGSTKSZ);
signal_stack = (char *)alloc(SIGSTKSZ);
init_signal_stack();
#endif
}
@@ -2936,7 +2936,8 @@ mch_free_mem()
}
# endif
# endif
# ifdef FEAT_X11
/* Don't close the display for GTK 1, it is done in exit(). */
# if defined(FEAT_X11) && (!defined(FEAT_GUI_GTK) || defined(HAVE_GTK2))
if (x11_display != NULL
# ifdef FEAT_XCLIPBOARD
&& x11_display != xterm_dpy
@@ -6814,7 +6815,8 @@ xsmp_close()
if (xsmp_icefd != -1)
{
SmcCloseConnection(xsmp.smcconn, 0, NULL);
vim_free(xsmp.clientid);
if (xsmp.clientid != NULL)
free(xsmp.clientid);
xsmp.clientid = NULL;
xsmp_icefd = -1;
}

View File

@@ -228,7 +228,7 @@ mch_getenv(char_u *lognam)
else if ((sbuf = getenv((char *)lognam)))
{
lengte = strlen(sbuf) + 1;
cp = (char_u *)malloc((size_t)lengte);
cp = (char_u *)alloc((size_t)lengte);
if (cp)
strcpy((char *)cp, sbuf);
return cp;
@@ -381,7 +381,7 @@ vms_wproc(char *name, int val)
if (--vms_match_free == 0) {
/* add more space to store matches */
vms_match_alloced += EXPL_ALLOC_INC;
vms_fmatch = (char_u **)realloc(vms_fmatch,
vms_fmatch = (char_u **)vim_realloc(vms_fmatch,
sizeof(char **) * vms_match_alloced);
if (!vms_fmatch)
return 0;
@@ -460,7 +460,7 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
if (--files_free < 1)
{
files_alloced += EXPL_ALLOC_INC;
*file = (char_u **)realloc(*file,
*file = (char_u **)vim_realloc(*file,
sizeof(char_u **) * files_alloced);
if (*file == NULL)
{
@@ -614,14 +614,14 @@ vms_fixfilename(void *instring)
{
buflen = len + 128;
if (buf)
buf = (char *)realloc(buf, buflen);
buf = (char *)vim_realloc(buf, buflen);
else
buf = (char *)calloc(buflen, sizeof(char));
buf = (char *)alloc(buflen * sizeof(char));
}
#ifdef DEBUG
char *tmpbuf = NULL;
tmpbuf = (char *)calloc(buflen, sizeof(char));
tmpbuf = (char *)alloc(buflen * sizeof(char));
strcpy(tmpbuf, instring);
#endif

View File

@@ -129,7 +129,8 @@ WinMain(
errout:
#endif
free(argv);
free(tofree);
if (tofree != NULL)
free(tofree);
#ifdef FEAT_MBYTE
free_cmd_argsW();
#endif

View File

@@ -121,7 +121,8 @@ WinMain(
pmain(argc, argv);
free(argv);
free(tofree);
if (tofree != NULL)
free(tofree);
return 0;
}

View File

@@ -573,7 +573,7 @@ pum_set_selected(n, repeat)
{
/* Don't want to sync undo in the current buffer. */
++no_u_sync;
res = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, 0);
res = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, 0, NULL);
--no_u_sync;
if (res == OK)
{

View File

@@ -33,7 +33,7 @@ buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
char_u *getaltfname __ARGS((int errmsg));
int buflist_add __ARGS((char_u *fname, int flags));
void buflist_slash_adjust __ARGS((void));
void buflist_altfpos __ARGS((void));
void buflist_altfpos __ARGS((win_T *win));
int otherfile __ARGS((char_u *ffname));
void buf_setino __ARGS((buf_T *buf));
void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));

View File

@@ -61,7 +61,7 @@ void set_vim_var_nr __ARGS((int idx, long val));
long get_vim_var_nr __ARGS((int idx));
char_u *get_vim_var_str __ARGS((int idx));
list_T *get_vim_var_list __ARGS((int idx));
void set_vcount __ARGS((long count, long count1));
void set_vcount __ARGS((long count, long count1, int set_prevcount));
void set_vim_var_string __ARGS((int idx, char_u *val, int len));
void set_vim_var_list __ARGS((int idx, list_T *val));
void set_reg_var __ARGS((int c));

View File

@@ -27,7 +27,7 @@ void ex_wnext __ARGS((exarg_T *eap));
void do_wqall __ARGS((exarg_T *eap));
int not_writing __ARGS((void));
int getfile __ARGS((int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, int forceit));
int do_ecmd __ARGS((int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags));
int do_ecmd __ARGS((int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags, win_T *oldwin));
void ex_append __ARGS((exarg_T *eap));
void ex_change __ARGS((exarg_T *eap));
void ex_z __ARGS((exarg_T *eap));

View File

@@ -1420,6 +1420,7 @@ qf_jump(qi, dir, errornr, forceit)
win_T *win;
win_T *altwin;
#endif
win_T *oldwin = curwin;
int print_message = TRUE;
int len;
#ifdef FEAT_FOLDING
@@ -1744,7 +1745,8 @@ qf_jump(qi, dir, errornr, forceit)
}
else
ok = do_ecmd(qf_ptr->qf_fnum, NULL, NULL, NULL, (linenr_T)1,
ECMD_HIDE + ECMD_SET_HELP);
ECMD_HIDE + ECMD_SET_HELP,
oldwin == curwin ? curwin : NULL);
}
else
ok = buflist_getfile(qf_ptr->qf_fnum,
@@ -2267,6 +2269,7 @@ ex_copen(eap)
win_T *win;
tabpage_T *prevtab = curtab;
buf_T *qf_buf;
win_T *oldwin = curwin;
if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
{
@@ -2326,14 +2329,16 @@ ex_copen(eap)
win->w_llist->qf_refcount++;
}
if (oldwin != curwin)
oldwin = NULL; /* don't store info when in another window */
if (qf_buf != NULL)
/* Use the existing quickfix buffer */
(void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
ECMD_HIDE + ECMD_OLDBUF);
ECMD_HIDE + ECMD_OLDBUF, oldwin);
else
{
/* Create a new quickfix buffer */
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, oldwin);
/* switch off 'swapfile' */
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",

View File

@@ -1784,10 +1784,15 @@ struct window_S
#endif
/*
* The next three specify the offsets for displaying the buffer:
* "w_topline", "w_leftcol" and "w_skipcol" specify the offsets for
* displaying the buffer.
*/
linenr_T w_topline; /* buffer line number of the line at the
top of the window */
#ifdef FEAT_AUTOCMD
char w_topline_was_set; /* flag set to TRUE when topline is set,
e.g. by winrestview() */
#endif
#ifdef FEAT_DIFF
int w_topfill; /* number of filler lines above w_topline */
int w_old_topfill; /* w_topfill at last redraw */

Binary file not shown.

View File

@@ -676,6 +676,40 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
48,
/**/
47,
/**/
46,
/**/
45,
/**/
44,
/**/
43,
/**/
42,
/**/
41,
/**/
40,
/**/
39,
/**/
38,
/**/
37,
/**/
36,
/**/
35,
/**/
34,
/**/
33,
/**/
32,
/**/
31,
/**/

View File

@@ -341,8 +341,14 @@
#ifdef BACKSLASH_IN_FILENAME
# define PATH_ESC_CHARS ((char_u *)" \t\n*?[{`%#'\"|!<")
#else
# define PATH_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<")
# define SHELL_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<>();&")
# ifdef VMS
/* VMS allows a lot of characters in the file name */
# define PATH_ESC_CHARS ((char_u *)" \t\n*?{`\\%#'\"|!")
# define SHELL_ESC_CHARS ((char_u *)" \t\n*?{`\\%#'|!()&")
# else
# define PATH_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<")
# define SHELL_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<>();&")
# endif
#endif
#define NUMBUFLEN 30 /* length of a buffer to store a number in ASCII */
@@ -370,7 +376,7 @@ typedef __int64 long_i;
* Define __w64 as an empty token for everything but MSVC 7.x or later.
*/
# if !defined(_MSC_VER) || (_MSC_VER < 1300)
# define __w64
# define __w64
# endif
typedef unsigned long __w64 long_u;
typedef long __w64 long_i;
@@ -1980,6 +1986,9 @@ typedef int VimClipboard; /* This is required for the prototypes. */
# endif
#endif
#ifndef FEAT_NETBEANS_INTG
# undef NBDEBUG
#endif
#ifdef NBDEBUG /* Netbeans debugging. */
# include "nbdebug.h"
#else

View File

@@ -531,7 +531,8 @@ wingotofile:
# ifdef FEAT_SCROLLBIND
curwin->w_p_scb = FALSE;
# endif
(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, ECMD_HIDE);
(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL,
ECMD_HIDE, NULL);
if (nchar == 'F' && lnum >= 0)
{
curwin->w_cursor.lnum = lnum;