Compare commits

...

21 Commits

Author SHA1 Message Date
Bram Moolenaar
c066202665 updated for version 7.2-254 2009-09-11 13:04:24 +00:00
Bram Moolenaar
fa68b0fc1a updated for version 7.2-253 2009-09-11 12:19:51 +00:00
Bram Moolenaar
183bb3e4b6 updated for version 7.2-252 2009-09-11 12:02:34 +00:00
Bram Moolenaar
1d7ad738e5 updated for version 7.2-251 2009-09-11 11:44:54 +00:00
Bram Moolenaar
dc7e00e848 updated for version 7.2-250 2009-09-11 11:26:56 +00:00
Bram Moolenaar
1c6136a8a5 updated for version 7.2-249 2009-09-11 11:00:05 +00:00
Bram Moolenaar
2d6db76d97 updated for version 7.2-248 2009-09-11 10:49:58 +00:00
Bram Moolenaar
e484c94514 updated for version 7.2-247 2009-09-11 10:21:41 +00:00
Bram Moolenaar
8ae39d8432 updated for version 7.2-246 2009-09-11 09:30:34 +00:00
Bram Moolenaar
b5cdf2eab3 updated for version 7.2-245 2009-07-29 16:25:31 +00:00
Bram Moolenaar
32b485f2b0 updated for version 7.2-244 2009-07-29 16:06:27 +00:00
Bram Moolenaar
5e9b4540fd updated for version 7.2-243 2009-07-29 14:24:36 +00:00
Bram Moolenaar
801f8b865c updated for version 7.2-242 2009-07-29 13:42:05 +00:00
Bram Moolenaar
6bef63c651 updated for version 7.2-241 2009-07-29 10:10:29 +00:00
Bram Moolenaar
9f8650c969 updated for version 7.2-240 2009-07-29 09:11:15 +00:00
Bram Moolenaar
6ec0a6c43d updated for version 7.2-239 2009-07-22 14:23:13 +00:00
Bram Moolenaar
363cb67afa updated for version 7.2-238 2009-07-22 12:28:17 +00:00
Bram Moolenaar
20de1c20e6 updated for version 7.2-237 2009-07-22 11:28:11 +00:00
Bram Moolenaar
996b6d86cc updated for version 7.2-236 2009-07-22 09:17:23 +00:00
Bram Moolenaar
b245016c15 updated for version 7.2-235 2009-07-22 09:04:20 +00:00
Bram Moolenaar
055a2ba10e updated for version 7.2-234 2009-07-14 19:40:21 +00:00
25 changed files with 351 additions and 84 deletions

View File

@@ -441,13 +441,20 @@ between files with almost the same name. If there are multiple matches,
those files with an extension that is in the 'suffixes' option are ignored.
The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending
in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored.
It is impossible to ignore suffixes with two dots. Examples:
An empty entry, two consecutive commas, match a file name that does not
contain a ".", thus has no suffix. This is useful to ignore "prog" and prefer
"prog.c".
Examples:
pattern: files: match: ~
test* test.c test.h test.o test.c
test* test.h test.o test.h and test.o
test* test.i test.h test.c test.i and test.c
It is impossible to ignore suffixes with two dots.
If there is more than one matching file (after ignoring the ones matching
the 'suffixes' option) the first file name is inserted. You can see that
there is only one match when you type 'wildchar' twice and the completed

View File

@@ -481,7 +481,8 @@ bit of code) was adapted from the cscope interface in nvi. Please report
any problems, suggestions, patches, et al., you have for the usage of
cscope within Vim to him.
*cscope-win32*
For a cscope version for Win32 see: http://iamphet.nm.ru/cscope/index.html
For a cscope version for Win32 see:
http://code.google.com/p/cscope-win32/
Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact
him if you have Win32-specific issues.

View File

@@ -635,7 +635,9 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
}
// Now concatenate
strncpy(temp, _("Edit with existing Vim - "), BUFSIZE - 1);
strncat(temp, title, BUFSIZE - 1);
temp[BUFSIZE - 1] = '\0';
strncat(temp, title, BUFSIZE - 1 - strlen(temp));
temp[BUFSIZE - 1] = '\0';
InsertMenu(hMenu,
indexMenu++,
MF_STRING|MF_BYPOSITION,

View File

@@ -212,13 +212,34 @@ ifndef MZSCHEME_VER
MZSCHEME_VER = 209_000
endif
ifndef MZSCHEME_PRECISE_GC
MZSCHEME_PRECISE_GC=no
endif
# for version 4.x we need to generate byte-code for Scheme base
ifndef MZSCHEME_GENERATE_BASE
MZSCHEME_GENERATE_BASE=no
endif
ifeq (yes, $(DYNAMIC_MZSCHEME))
DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
else
ifndef MZSCHEME_DLLS
MZSCHEME_DLLS = $(MZSCHEME)
endif
EXTRA_LIBS += -L$(MZSCHEME_DLLS) -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
ifeq (yes,$(MZSCHEME_PRECISE_GC))
MZSCHEME_LIB=-lmzsch$(MZSCHEME_VER)
else
MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
endif
EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB)
endif
ifeq (yes,$(MZSCHEME_GENERATE_BASE))
DEFINES += -DINCLUDE_MZSCHEME_BASE
MZ_EXTRA_DEP += mzscheme_base.c
endif
ifeq (yes,$(MZSCHEME_PRECISE_GC))
DEFINES += -DMZ_PRECISE_GC
endif
endif
@@ -472,6 +493,9 @@ clean:
-$(DEL) $(EXE) vimrun.exe install.exe uninstal.exe
ifdef PERL
-$(DEL) if_perl.c
endif
ifdef MZSCHEME
-$(DEL) mzscheme_base.c
endif
-$(DEL) pathdef.c
$(MAKE) -C xxd -f Make_cyg.mak clean
@@ -523,9 +547,15 @@ endif
$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP)
$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
$(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
mzscheme_base.c:
$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
pathdef.c: $(INCL)
ifneq (sh.exe, $(SHELL))
@echo creating pathdef.c

View File

@@ -135,7 +135,7 @@ endif
ifndef MZSCHEME_DLLS
MZSCHEME_DLLS=$(MZSCHEME)
endif
MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS)
MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
endif
endif
@@ -562,6 +562,9 @@ clean:
-$(DEL) pathdef.c
ifdef PERL
-$(DEL) if_perl.c
endif
ifdef MZSCHEME
-$(DEL) mzscheme_base.c
endif
$(MAKE) -C GvimExt -f Make_ming.mak clean
$(MAKE) -C xxd -f Make_cyg.mak clean

View File

@@ -865,6 +865,7 @@ clean:
- if exist dimm_i.c del dimm_i.c
- if exist dimm.tlb del dimm.tlb
- if exist dosinst.exe del dosinst.exe
- if exist mzscheme_base.c del mzscheme_base.c
cd xxd
$(MAKE) /NOLOGO -f Make_mvc.mak clean
cd ..

7
src/auto/configure vendored
View File

@@ -5780,7 +5780,10 @@ $as_echo "$rubyhdrdir" >&6; }
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LDFLAGS"]'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
fi
RUBY_SRC="if_ruby.c"
RUBY_OBJ="objects/if_ruby.o"
@@ -17132,7 +17135,7 @@ $as_echo "no" >&6; }
{ $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"
CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'`
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
else

View File

@@ -174,6 +174,11 @@ buf_init_chartab(buf, global)
if (VIM_ISDIGIT(*p))
c = getdigits(&p);
else
#ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_ptr2char_adv(&p);
else
#endif
c = *p++;
c2 = -1;
if (*p == '-' && p[1] != NUL)

View File

@@ -984,7 +984,13 @@ if test "$enable_rubyinterp" = "yes"; then
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
dnl be included if requested by passing --with-mac-arch to
dnl configure, so strip these flags first (if present)
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
fi
RUBY_SRC="if_ruby.c"
RUBY_OBJ="objects/if_ruby.o"
@@ -3227,7 +3233,7 @@ if test "$GCC" = yes; then
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"
CFLAGS=`echo "$CFLAGS -D_FORTIFY_SOURCE=1" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' -e 's/-D_FORTIFY_SOURCE=2//g'`
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)

View File

@@ -893,6 +893,7 @@ ex_diffpatch(eap)
char_u *browseFile = NULL;
int browse_flag = cmdmod.browse;
#endif
struct stat st;
#ifdef FEAT_BROWSE
if (cmdmod.browse)
@@ -999,44 +1000,51 @@ ex_diffpatch(eap)
STRCAT(buf, ".rej");
mch_remove(buf);
if (curbuf->b_fname != NULL)
/* Only continue if the output file was created. */
if (mch_stat((char *)tmp_new, &st) < 0 || st.st_size == 0)
EMSG(_("E816: Cannot read patch output"));
else
{
newname = vim_strnsave(curbuf->b_fname,
if (curbuf->b_fname != NULL)
{
newname = vim_strnsave(curbuf->b_fname,
(int)(STRLEN(curbuf->b_fname) + 4));
if (newname != NULL)
STRCAT(newname, ".new");
}
if (newname != NULL)
STRCAT(newname, ".new");
}
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
need_mouse_correct = TRUE;
#endif
/* don't use a new tab page, each tab page has its own diffs */
cmdmod.tab = 0;
/* don't use a new tab page, each tab page has its own diffs */
cmdmod.tab = 0;
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
{
/* Pretend it was a ":split fname" command */
eap->cmdidx = CMD_split;
eap->arg = tmp_new;
do_exedit(eap, old_curwin);
if (curwin != old_curwin) /* split must have worked */
if (win_split(0, (diff_flags & DIFF_VERTICAL) ? WSP_VERT : 0) != FAIL)
{
/* Set 'diff', 'scrollbind' on and 'wrap' off. */
diff_win_options(curwin, TRUE);
diff_win_options(old_curwin, TRUE);
/* Pretend it was a ":split fname" command */
eap->cmdidx = CMD_split;
eap->arg = tmp_new;
do_exedit(eap, old_curwin);
if (newname != NULL)
/* check that split worked and editing tmp_new */
if (curwin != old_curwin && win_valid(old_curwin))
{
/* do a ":file filename.new" on the patched buffer */
eap->arg = newname;
ex_file(eap);
/* Set 'diff', 'scrollbind' on and 'wrap' off. */
diff_win_options(curwin, TRUE);
diff_win_options(old_curwin, TRUE);
if (newname != NULL)
{
/* do a ":file filename.new" on the patched buffer */
eap->arg = newname;
ex_file(eap);
#ifdef FEAT_AUTOCMD
/* Do filetype detection with the new name. */
if (au_has_group((char_u *)"filetypedetect"))
do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
/* Do filetype detection with the new name. */
if (au_has_group((char_u *)"filetypedetect"))
do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
#endif
}
}
}
}

View File

@@ -121,6 +121,8 @@ struct bw_info
char_u *bw_conv_buf; /* buffer for writing converted chars */
int bw_conv_buflen; /* size of bw_conv_buf */
int bw_conv_error; /* set for conversion error */
linenr_T bw_conv_error_lnum; /* first line with error or zero */
linenr_T bw_start_lnum; /* line number at start of buffer */
# ifdef USE_ICONV
iconv_t bw_iconv_fd; /* descriptor for iconv() or -1 */
# endif
@@ -132,7 +134,7 @@ static int buf_write_bytes __ARGS((struct bw_info *ip));
#ifdef FEAT_MBYTE
static linenr_T readfile_linenr __ARGS((linenr_T linecnt, char_u *p, char_u *endp));
static int ucs2bytes __ARGS((unsigned c, char_u **pp, int flags));
static int same_encoding __ARGS((char_u *a, char_u *b));
static int need_conversion __ARGS((char_u *fenc));
static int get_fio_flags __ARGS((char_u *ptr));
static char_u *check_for_bom __ARGS((char_u *p, long size, int *lenp, int flags));
static int make_bom __ARGS((char_u *buf, char_u *name));
@@ -1041,13 +1043,12 @@ retry:
}
/*
* Conversion is required when the encoding of the file is different
* from 'encoding' or 'encoding' is UTF-16, UCS-2 or UCS-4 (requires
* conversion to UTF-8).
* Conversion may be required when the encoding of the file is different
* from 'encoding' or 'encoding' is UTF-16, UCS-2 or UCS-4.
*/
fio_flags = 0;
converted = (*fenc != NUL && !same_encoding(p_enc, fenc));
if (converted || enc_unicode != 0)
converted = need_conversion(fenc);
if (converted)
{
/* "ucs-bom" means we need to check the first bytes of the file
@@ -2924,6 +2925,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
linenr_T lnum;
long nchars;
char_u *errmsg = NULL;
int errmsg_allocated = FALSE;
char_u *errnum = NULL;
char_u *buffer;
char_u smallbuf[SMBUFSIZE];
@@ -2987,6 +2989,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
/* must init bw_conv_buf and bw_iconv_fd before jumping to "fail" */
write_info.bw_conv_buf = NULL;
write_info.bw_conv_error = FALSE;
write_info.bw_conv_error_lnum = 0;
write_info.bw_restlen = 0;
# ifdef USE_ICONV
write_info.bw_iconv_fd = (iconv_t)-1;
@@ -3965,10 +3968,9 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
fenc = buf->b_p_fenc;
/*
* The file needs to be converted when 'fileencoding' is set and
* 'fileencoding' differs from 'encoding'.
* Check if the file needs to be converted.
*/
converted = (*fenc != NUL && !same_encoding(p_enc, fenc));
converted = need_conversion(fenc);
/*
* Check if UTF-8 to UCS-2/4 or Latin1 conversion needs to be done. Or
@@ -4243,6 +4245,7 @@ restore_backup:
nchars += write_info.bw_len;
}
}
write_info.bw_start_lnum = start;
#endif
write_info.bw_len = bufsize;
@@ -4278,6 +4281,9 @@ restore_backup:
nchars += bufsize;
s = buffer;
len = 0;
#ifdef FEAT_MBYTE
write_info.bw_start_lnum = lnum;
#endif
}
/* write failed or last line has no EOL: stop here */
if (end == 0
@@ -4474,7 +4480,17 @@ restore_backup:
{
#ifdef FEAT_MBYTE
if (write_info.bw_conv_error)
errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
{
if (write_info.bw_conv_error_lnum == 0)
errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
else
{
errmsg_allocated = TRUE;
errmsg = alloc(300);
vim_snprintf((char *)errmsg, 300, _("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"),
(long)write_info.bw_conv_error_lnum);
}
}
else
#endif
if (got_int)
@@ -4550,6 +4566,12 @@ restore_backup:
{
STRCAT(IObuff, _(" CONVERSION ERROR"));
c = TRUE;
if (write_info.bw_conv_error_lnum != 0)
{
size_t l = STRLEN(IObuff);
vim_snprintf((char *)IObuff + l, IOSIZE - l, _(" in line %ld;"),
(long)write_info.bw_conv_error_lnum);
}
}
else if (notconverted)
{
@@ -4746,6 +4768,8 @@ nofail:
}
STRCAT(IObuff, errmsg);
emsg(IObuff);
if (errmsg_allocated)
vim_free(errmsg);
retval = FAIL;
if (end == 0)
@@ -5105,7 +5129,13 @@ buf_write_bytes(ip)
c = buf[wlen];
}
ip->bw_conv_error |= ucs2bytes(c, &p, flags);
if (ucs2bytes(c, &p, flags) && !ip->bw_conv_error)
{
ip->bw_conv_error = TRUE;
ip->bw_conv_error_lnum = ip->bw_start_lnum;
}
if (c == NL)
++ip->bw_start_lnum;
}
if (flags & FIO_LATIN1)
len = (int)(p - buf);
@@ -5386,6 +5416,7 @@ buf_write_bytes(ip)
#ifdef FEAT_MBYTE
/*
* Convert a Unicode character to bytes.
* Return TRUE for an error, FALSE when it's OK.
*/
static int
ucs2bytes(c, pp, flags)
@@ -5469,20 +5500,37 @@ ucs2bytes(c, pp, flags)
}
/*
* Return TRUE if "a" and "b" are the same 'encoding'.
* Ignores difference between "ansi" and "latin1", "ucs-4" and "ucs-4be", etc.
* Return TRUE if file encoding "fenc" requires conversion from or to
* 'encoding'.
*/
static int
same_encoding(a, b)
char_u *a;
char_u *b;
need_conversion(fenc)
char_u *fenc;
{
int f;
int same_encoding;
int enc_flags;
int fenc_flags;
if (STRCMP(a, b) == 0)
return TRUE;
f = get_fio_flags(a);
return (f != 0 && get_fio_flags(b) == f);
if (*fenc == NUL || STRCMP(p_enc, fenc) == 0)
same_encoding = TRUE;
else
{
/* Ignore difference between "ansi" and "latin1", "ucs-4" and
* "ucs-4be", etc. */
enc_flags = get_fio_flags(p_enc);
fenc_flags = get_fio_flags(fenc);
same_encoding = (enc_flags != 0 && fenc_flags == enc_flags);
}
if (same_encoding)
{
/* Specified encoding matches with 'encoding'. This requires
* conversion when 'encoding' is Unicode but not UTF-8. */
return enc_unicode != 0;
}
/* Encodings differ. However, conversion is not needed when 'enc' is any
* Unicode encoding and the file is UTF-8. */
return !(enc_utf8 && fenc_flags == FIO_UTF8);
}
/*
@@ -8420,6 +8468,10 @@ aucmd_prepbuf(aco, buf)
if (aucmd_win == NULL)
win = curwin;
}
if (win == NULL && aucmd_win_used)
/* Strange recursive autocommand, fall back to using the current
* window. Expect a few side effects... */
win = curwin;
aco->save_curwin = curwin;
aco->save_curbuf = curbuf;
@@ -8428,6 +8480,7 @@ aucmd_prepbuf(aco, buf)
/* There is a window for "buf" in the current tab page, make it the
* curwin. This is preferred, it has the least side effects (esp. if
* "buf" is curbuf). */
aco->use_aucmd_win = FALSE;
curwin = win;
}
else
@@ -8436,9 +8489,20 @@ aucmd_prepbuf(aco, buf)
* effects, insert it in a the current tab page.
* Anything related to a window (e.g., setting folds) may have
* unexpected results. */
aco->use_aucmd_win = TRUE;
aucmd_win_used = TRUE;
aucmd_win->w_buffer = buf;
++buf->b_nwindows;
win_init_empty(aucmd_win); /* set cursor and topline to safe values */
vim_free(aucmd_win->w_localdir);
aucmd_win->w_localdir = NULL;
/* Make sure w_localdir and globaldir are NULL to avoid a chdir() in
* win_enter_ext(). */
aucmd_win->w_localdir = NULL;
aco->globaldir = globaldir;
globaldir = NULL;
#ifdef FEAT_WINDOWS
/* Split the current window, put the aucmd_win in the upper half.
@@ -8472,7 +8536,7 @@ aucmd_restbuf(aco)
int dummy;
#endif
if (aco->new_curwin == aucmd_win)
if (aco->use_aucmd_win)
{
--curbuf->b_nwindows;
#ifdef FEAT_WINDOWS
@@ -8499,6 +8563,7 @@ aucmd_restbuf(aco)
/* Remove the window and frame from the tree of frames. */
(void)winframe_remove(curwin, &dummy, NULL);
win_remove(curwin, NULL);
aucmd_win_used = FALSE;
last_status(FALSE); /* may need to remove last status line */
restore_snapshot(SNAP_AUCMD_IDX, FALSE);
(void)win_comp_pos(); /* recompute window positions */
@@ -8517,6 +8582,9 @@ aucmd_restbuf(aco)
#endif
curbuf = curwin->w_buffer;
vim_free(globaldir);
globaldir = aco->globaldir;
/* the buffer contents may have changed */
check_cursor();
if (curwin->w_topline > curbuf->b_ml.ml_line_count)
@@ -8541,7 +8609,7 @@ aucmd_restbuf(aco)
#endif
{
/* Restore the buffer which was previously edited by curwin, if
* it was chagned, we are still the same window and the buffer is
* it was changed, we are still the same window and the buffer is
* valid. */
if (curwin == aco->new_curwin
&& curbuf != aco->new_curbuf

View File

@@ -541,6 +541,7 @@ EXTERN win_T *curwin; /* currently active window */
#ifdef FEAT_AUTOCMD
EXTERN win_T *aucmd_win; /* window used in aucmd_prepbuf() */
EXTERN int aucmd_win_used INIT(= FALSE); /* aucmd_win is being used */
#endif
/*

View File

@@ -5004,6 +5004,19 @@ gui_do_findrepl(flags, find_text, repl_text, down)
char_u *p;
regmatch_T regmatch;
int save_did_emsg = did_emsg;
static int busy = FALSE;
/* When the screen is being updated we should not change buffers and
* windows structures, it may cause freed memory to be used. Also don't
* do this recursively (pressing "Find" quickly several times. */
if (updating_screen || busy)
return FALSE;
/* refuse replace when text cannot be changed */
if ((type == FRD_REPLACE || type == FRD_REPLACEALL) && text_locked())
return FALSE;
busy = TRUE;
ga_init2(&ga, 1, 100);
if (type == FRD_REPLACEALL)
@@ -5094,6 +5107,7 @@ gui_do_findrepl(flags, find_text, repl_text, down)
}
vim_free(ga.ga_data);
busy = FALSE;
return (ga.ga_len > 0);
}

View File

@@ -635,8 +635,10 @@ dynamic_mzscheme_end(void)
#endif /* DYNAMIC_MZSCHEME */
/* need to put it here for dynamic stuff to work */
#ifdef INCLUDE_MZSCHEME_BASE
#if defined(INCLUDE_MZSCHEME_BASE)
# include "mzscheme_base.c"
#elif MZSCHEME_VERSION_MAJOR >= 400
# error MzScheme 4.x must include mzscheme_base.c, for MinGW32 you need to define MZSCHEME_GENERATE_BASE=yes
#endif
/*
@@ -875,14 +877,14 @@ startup_mzscheme(void)
#ifdef INCLUDE_MZSCHEME_BASE
{
/*
* versions 4.x do not provide Scheme bindings by defaults
* versions 4.x do not provide Scheme bindings by default
* we need to add them explicitly
*/
Scheme_Object *scheme_base_symbol = NULL;
MZ_GC_DECL_REG(1);
MZ_GC_VAR_IN_REG(0, scheme_base_symbol);
MZ_GC_REG();
/* invoke function from generated and included base.c */
/* invoke function from generated and included mzscheme_base.c */
declare_modules(environment);
scheme_base_symbol = scheme_intern_symbol("scheme/base");
MZ_GC_CHECK();

View File

@@ -3276,6 +3276,7 @@ prompt_for_number(mouse_used)
cmdline_row = msg_row - 1;
need_wait_return = FALSE;
msg_didany = FALSE;
msg_didout = FALSE;
}
else
cmdline_row = save_cmdline_row;
@@ -8533,11 +8534,25 @@ match_suffix(fname)
for (setsuf = p_su; *setsuf; )
{
setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,");
if (fnamelen >= setsuflen
&& fnamencmp(suf_buf, fname + fnamelen - setsuflen,
(size_t)setsuflen) == 0)
break;
setsuflen = 0;
if (setsuflen == 0)
{
char_u *tail = gettail(fname);
/* empty entry: match name without a '.' */
if (vim_strchr(tail, '.') == NULL)
{
setsuflen = 1;
break;
}
}
else
{
if (fnamelen >= setsuflen
&& fnamencmp(suf_buf, fname + fnamelen - setsuflen,
(size_t)setsuflen) == 0)
break;
setsuflen = 0;
}
}
return (setsuflen != 0);
}

View File

@@ -1499,7 +1499,8 @@ nb_do_cmd(
return FAIL;
}
first = *pos;
nbdebug((" FIRST POS: line %d, col %d\n", first.lnum, first.col));
nbdebug((" FIRST POS: line %d, col %d\n",
first.lnum, first.col));
pos = off2pos(buf->bufp, off+count-1);
if (!pos)
{
@@ -1510,7 +1511,8 @@ nb_do_cmd(
return FAIL;
}
last = *pos;
nbdebug((" LAST POS: line %d, col %d\n", last.lnum, last.col));
nbdebug((" LAST POS: line %d, col %d\n",
last.lnum, last.col));
del_from_lnum = first.lnum;
del_to_lnum = last.lnum;
doupdate = 1;
@@ -1521,7 +1523,8 @@ nb_do_cmd(
next = off2pos(buf->bufp, off + count);
/* Remove part of the first line. */
if (first.col != 0 || (next != NULL && first.lnum == next->lnum))
if (first.col != 0
|| (next != NULL && first.lnum == next->lnum))
{
if (first.lnum != last.lnum
|| (next != NULL && first.lnum != next->lnum))
@@ -1584,7 +1587,8 @@ nb_do_cmd(
int id = buf_findsign_id(buf->bufp, (linenr_T)i);
if (id > 0)
{
nbdebug((" Deleting sign %d on line %d\n", id, i));
nbdebug((" Deleting sign %d on line %d\n",
id, i));
buf_delsign(buf->bufp, id);
}
else
@@ -1593,7 +1597,8 @@ nb_do_cmd(
}
}
nbdebug((" Deleting lines %d through %d\n", del_from_lnum, del_to_lnum));
nbdebug((" Deleting lines %d through %d\n",
del_from_lnum, del_to_lnum));
curwin->w_cursor.lnum = del_from_lnum;
curwin->w_cursor.col = 0;
del_lines(del_to_lnum - del_from_lnum + 1, FALSE);
@@ -3514,7 +3519,8 @@ get_buf_size(buf_T *bufp)
eol_size = 1;
for (lnum = 1; lnum <= bufp->b_ml.ml_line_count; ++lnum)
{
char_count += (long)STRLEN(ml_get(lnum)) + eol_size;
char_count += (long)STRLEN(ml_get_buf(bufp, lnum, FALSE))
+ eol_size;
/* Check for a CTRL-C every 100000 characters */
if (char_count > last_check)
{

View File

@@ -403,8 +403,9 @@ struct vimoption
#define P_NUM 0x02 /* the option is numeric */
#define P_STRING 0x04 /* the option is a string */
#define P_ALLOCED 0x08 /* the string option is in allocated memory,
must use vim_free() when assigning new
value. Not set if default is the same. */
must use free_string_option() when
assigning new value. Not set if default is
the same. */
#define P_EXPAND 0x10 /* environment expansion. NOTE: P_EXPAND can
never be used for local or hidden options! */
#define P_NODEFAULT 0x40 /* don't set to default value */
@@ -7193,6 +7194,14 @@ set_bool_option(opt_idx, varp, value, opt_flags)
compatible_set();
}
/* 'list', 'number' */
else if ((int *)varp == &curwin->w_p_list
|| (int *)varp == &curwin->w_p_nu)
{
if (curwin->w_curswant != MAXCOL)
curwin->w_set_curswant = TRUE;
}
else if ((int *)varp == &curbuf->b_p_ro)
{
/* when 'readonly' is reset globally, also reset readonlymode */
@@ -7644,6 +7653,14 @@ set_bool_option(opt_idx, varp, value, opt_flags)
curbuf->b_p_imsearch = B_IMODE_USE_INSERT;
# endif
}
if (curwin->w_curswant != MAXCOL)
curwin->w_set_curswant = TRUE;
}
else if ((int *)varp == &p_arshape)
{
if (curwin->w_curswant != MAXCOL)
curwin->w_set_curswant = TRUE;
}
#endif
@@ -7654,8 +7671,7 @@ set_bool_option(opt_idx, varp, value, opt_flags)
options[opt_idx].flags |= P_WAS_SET;
comp_col(); /* in case 'ruler' or 'showcmd' changed */
if (curwin->w_curswant != MAXCOL)
curwin->w_set_curswant = TRUE; /* in case 'list' changed */
check_redraw(options[opt_idx].flags);
return NULL;
@@ -8926,6 +8942,28 @@ free_termoptions()
clear_termcodes();
}
/*
* Free the string for one term option, if it was allocated.
* Set the string to empty_option and clear allocated flag.
* "var" points to the option value.
*/
void
free_one_termoption(var)
char_u *var;
{
struct vimoption *p;
for (p = &options[0]; p->fullname != NULL; p++)
if (p->var == var)
{
if (p->flags & P_ALLOCED)
free_string_option(*(char_u **)(p->var));
*(char_u **)(p->var) = empty_option;
p->flags &= ~P_ALLOCED;
break;
}
}
/*
* Set the terminal option defaults to the current value.
* Used after setting the terminal name.

View File

@@ -1734,9 +1734,9 @@ get_x11_icon(test_only)
if (oldicon == NULL && !test_only)
{
if (STRNCMP(T_NAME, "builtin_", 8) == 0)
oldicon = T_NAME + 8;
oldicon = vim_strsave(T_NAME + 8);
else
oldicon = T_NAME;
oldicon = vim_strsave(T_NAME);
}
return retval;
@@ -1939,9 +1939,9 @@ get_x11_icon(test_only)
if (!test_only)
{
if (STRNCMP(T_NAME, "builtin_", 8) == 0)
oldicon = T_NAME + 8;
oldicon = vim_strsave(T_NAME + 8);
else
oldicon = T_NAME;
oldicon = vim_strsave(T_NAME);
}
return FALSE;
}

View File

@@ -23,6 +23,9 @@ func! GetMline()
" remove '%', not used for formatting.
let idline = substitute(idline, "'%'", '', 'g')
" remove '%' used for plural forms.
let idline = substitute(idline, '\\nPlural-Forms: .\+;\\n', '', '')
" remove everything but % items.
return substitute(idline, '[^%]*\(%[-+ #''.0-9*]*l\=[dsuxXpoc%]\)\=', '\1', 'g')
endfunc

View File

@@ -29,6 +29,7 @@ int makeset __ARGS((FILE *fd, int opt_flags, int local_only));
int makefoldset __ARGS((FILE *fd));
void clear_termoptions __ARGS((void));
void free_termoptions __ARGS((void));
void free_one_termoption __ARGS((char_u *var));
void set_term_defaults __ARGS((void));
void comp_col __ARGS((void));
char_u *get_equalprg __ARGS((void));

View File

@@ -7467,6 +7467,10 @@ retry:
*/
FOR_ALL_TAB_WINDOWS(tp, wp)
win_free_lsize(wp);
#ifdef FEAT_AUTOCMD
if (aucmd_win != NULL)
win_free_lsize(aucmd_win);
#endif
new_ScreenLines = (schar_T *)lalloc((long_u)(
(Rows + 1) * Columns * sizeof(schar_T)), FALSE);
@@ -7504,7 +7508,8 @@ retry:
}
}
#ifdef FEAT_AUTOCMD
if (aucmd_win != NULL && win_alloc_lines(aucmd_win) == FAIL)
if (aucmd_win != NULL && aucmd_win->w_lines == NULL
&& win_alloc_lines(aucmd_win) == FAIL)
outofmem = TRUE;
#endif
#ifdef FEAT_WINDOWS

View File

@@ -10252,6 +10252,7 @@ spell_suggest(count)
int limit;
int selected = count;
int badlen = 0;
int msg_scroll_save = msg_scroll;
if (no_spell_checking(curwin))
return;
@@ -10416,7 +10417,9 @@ spell_suggest(count)
selected = prompt_for_number(&mouse_used);
if (mouse_used)
selected -= lines_left;
lines_left = Rows; /* avoid more prompt */
lines_left = Rows; /* avoid more prompt */
/* don't delay for 'smd' in normal_cmd() */
msg_scroll = msg_scroll_save;
}
if (selected > 0 && selected <= sug.su_ga.ga_len && u_save_cursor() == OK)
@@ -10441,7 +10444,8 @@ spell_suggest(count)
}
/* Replace the word. */
p = alloc((unsigned)STRLEN(line) - stp->st_orglen + stp->st_wordlen + 1);
p = alloc((unsigned)STRLEN(line) - stp->st_orglen
+ stp->st_wordlen + 1);
if (p != NULL)
{
c = (int)(sug.su_badptr - line);

View File

@@ -2288,9 +2288,11 @@ typedef struct
{
buf_T *save_curbuf; /* saved curbuf */
#ifdef FEAT_AUTOCMD
int use_aucmd_win; /* using aucmd_win */
win_T *save_curwin; /* saved curwin */
win_T *new_curwin; /* new curwin */
buf_T *new_curbuf; /* new curbuf */
char_u *globaldir; /* saved value of globaldir */
#endif
} aco_save_T;

View File

@@ -2881,7 +2881,7 @@ ttest(pairs)
/* if 'Sb' and 'AB' are not defined, reset "Co" */
if (*T_CSB == NUL && *T_CAB == NUL)
T_CCO = empty_option;
free_one_termoption(T_CCO);
/* Set 'weirdinvert' according to value of 't_xs' */
p_wiv = (*T_XS != NUL);

View File

@@ -676,6 +676,48 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
254,
/**/
253,
/**/
252,
/**/
251,
/**/
250,
/**/
249,
/**/
248,
/**/
247,
/**/
246,
/**/
245,
/**/
244,
/**/
243,
/**/
242,
/**/
241,
/**/
240,
/**/
239,
/**/
238,
/**/
237,
/**/
236,
/**/
235,
/**/
234,
/**/
233,
/**/