Compare commits

...

11 Commits

Author SHA1 Message Date
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
30 changed files with 196 additions and 78 deletions

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

@@ -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 */

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

@@ -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

@@ -2588,7 +2588,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

@@ -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

@@ -6050,7 +6050,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

@@ -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,28 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
42,
/**/
41,
/**/
40,
/**/
39,
/**/
38,
/**/
37,
/**/
36,
/**/
35,
/**/
34,
/**/
33,
/**/
32,
/**/
31,
/**/

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;