Compare commits

...

10 Commits

Author SHA1 Message Date
Bram Moolenaar
7baa45dbbf updated for version 7.1-080 2007-08-18 15:00:42 +00:00
Bram Moolenaar
deefb63bfb updated for version 7.1-079 2007-08-15 18:41:34 +00:00
Bram Moolenaar
70c2a63474 updated for version 7.1-078 2007-08-15 18:08:50 +00:00
Bram Moolenaar
349955a205 updated for version 7.1-077 2007-08-14 21:07:36 +00:00
Bram Moolenaar
b0db569905 updated for version 7.1-076 2007-08-14 20:54:49 +00:00
Bram Moolenaar
3185918f8c updated for version 7.1-075 2007-08-14 20:41:13 +00:00
Bram Moolenaar
92c5aba92a updated for version 7.1-074 2007-08-14 20:29:31 +00:00
Bram Moolenaar
4d64b7891b updated for version 7.1-073 2007-08-14 20:16:42 +00:00
Bram Moolenaar
9c03978012 updated for version 7.1-072 2007-08-14 15:55:42 +00:00
Bram Moolenaar
4d2fffc833 updated for version 7.1-071 2007-08-14 15:29:16 +00:00
18 changed files with 162 additions and 48 deletions

View File

@@ -69,14 +69,14 @@ getGvimName(char *name, int runtime)
// Registry didn't work, use the search path.
if (name[0] == 0)
strcpy(name, searchpath("gvim.exe"));
strcpy(name, searchpath((char *)"gvim.exe"));
if (!runtime)
{
// Only when looking for the executable, not the runtime dir, we can
// search for the batch file or a name without a path.
if (name[0] == 0)
strcpy(name, searchpath("gvim.bat"));
strcpy(name, searchpath((char *)"gvim.bat"));
if (name[0] == 0)
strcpy(name, "gvim"); // finds gvim.bat or gvim.exe
@@ -152,9 +152,9 @@ dyn_libintl_init(char *dir)
FARPROC *ptr;
} libintl_entry[] =
{
{"gettext", (FARPROC*)&dyn_libintl_gettext},
{"textdomain", (FARPROC*)&dyn_libintl_textdomain},
{"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
{(char *)"gettext", (FARPROC*)&dyn_libintl_gettext},
{(char *)"textdomain", (FARPROC*)&dyn_libintl_textdomain},
{(char *)"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
{NULL, NULL}
};
@@ -835,7 +835,7 @@ searchpath(char *name)
(LPTSTR)location) > (HINSTANCE)32)
return location;
}
return "";
return (char *)"";
}
# endif
#endif

View File

@@ -207,7 +207,10 @@ buf_init_chartab(buf, global)
}
while (c <= c2)
{
if (!do_isalpha || isalpha(c)
/* Use the MB_ functions here, because isalpha() doesn't
* work properly when 'encoding' is "latin1" and the locale is
* "C". */
if (!do_isalpha || MB_ISLOWER(c) || MB_ISUPPER(c)
#ifdef FEAT_FKMAP
|| (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))
#endif

View File

@@ -6802,7 +6802,7 @@ failret:
* "numbuf" is used for a number.
* Does not put quotes around strings, as ":echo" displays values.
* When "copyID" is not NULL replace recursive lists and dicts with "...".
* May return NULL;
* May return NULL.
*/
static char_u *
echo_string(tv, tofree, numbuf, copyID)
@@ -6887,7 +6887,7 @@ echo_string(tv, tofree, numbuf, copyID)
* If the memory is allocated "tofree" is set to it, otherwise NULL.
* "numbuf" is used for a number.
* Puts quotes around strings, so that they can be parsed back by eval().
* May return NULL;
* May return NULL.
*/
static char_u *
tv2string(tv, tofree, numbuf, copyID)
@@ -14974,6 +14974,10 @@ item_compare(s1, s2)
p1 = tv2string(&(*(listitem_T **)s1)->li_tv, &tofree1, numbuf1, 0);
p2 = tv2string(&(*(listitem_T **)s2)->li_tv, &tofree2, numbuf2, 0);
if (p1 == NULL)
p1 = (char_u *)"";
if (p2 == NULL)
p2 = (char_u *)"";
if (item_compare_ic)
res = STRICMP(p1, p2);
else
@@ -15463,7 +15467,8 @@ f_string(argvars, rettv)
rettv->v_type = VAR_STRING;
rettv->vval.v_string = tv2string(&argvars[0], &tofree, numbuf, 0);
if (tofree == NULL)
/* Make a copy if we have a value but it's not in allocate memory. */
if (rettv->vval.v_string != NULL && tofree == NULL)
rettv->vval.v_string = vim_strsave(rettv->vval.v_string);
}
@@ -18017,7 +18022,9 @@ list_one_var_a(prefix, name, type, string)
int type;
char_u *string;
{
msg_attr(prefix, 0); /* don't use msg(), it overwrites "v:statusmsg" */
/* don't use msg() or msg_attr() to avoid overwriting "v:statusmsg" */
msg_start();
msg_puts(prefix);
if (name != NULL) /* "a:" vars don't have a name stored */
msg_puts(name);
msg_putchar(' ');
@@ -20167,6 +20174,7 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
char_u buf[MSG_BUF_LEN];
char_u numbuf2[NUMBUFLEN];
char_u *tofree;
char_u *s;
msg_puts((char_u *)"(");
for (i = 0; i < argcount; ++i)
@@ -20177,10 +20185,13 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
msg_outnum((long)argvars[i].vval.v_number);
else
{
trunc_string(tv2string(&argvars[i], &tofree,
numbuf2, 0), buf, MSG_BUF_CLEN);
msg_puts(buf);
vim_free(tofree);
s = tv2string(&argvars[i], &tofree, numbuf2, 0);
if (s != NULL)
{
trunc_string(s, buf, MSG_BUF_CLEN);
msg_puts(buf);
vim_free(tofree);
}
}
}
msg_puts((char_u *)")");
@@ -20258,14 +20269,18 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
char_u buf[MSG_BUF_LEN];
char_u numbuf2[NUMBUFLEN];
char_u *tofree;
char_u *s;
/* The value may be very long. Skip the middle part, so that we
* have some idea how it starts and ends. smsg() would always
* truncate it at the end. */
trunc_string(tv2string(fc.rettv, &tofree, numbuf2, 0),
buf, MSG_BUF_CLEN);
smsg((char_u *)_("%s returning %s"), sourcing_name, buf);
vim_free(tofree);
s = tv2string(fc.rettv, &tofree, numbuf2, 0);
if (s != NULL)
{
trunc_string(s, buf, MSG_BUF_CLEN);
smsg((char_u *)_("%s returning %s"), sourcing_name, buf);
vim_free(tofree);
}
}
msg_puts((char_u *)"\n"); /* don't overwrite this either */

View File

@@ -4493,7 +4493,8 @@ separate_nextcmd(eap)
if (eap->argt & (USECTRLV | XFILE))
++p; /* skip CTRL-V and next char */
else
STRCPY(p, p + 1); /* remove CTRL-V and skip next char */
/* remove CTRL-V and skip next char */
mch_memmove(p, p + 1, STRLEN(p));
if (*p == NUL) /* stop at NUL after CTRL-V */
break;
}

View File

@@ -5117,7 +5117,7 @@ gui_handle_drop(x, y, modifiers, fnames, count)
p = vim_strsave_escaped(fnames[i], (char_u *)"\\ \t\"|");
# endif
if (p != NULL)
add_to_input_buf(p, (int)STRLEN(p));
add_to_input_buf_csi(p, (int)STRLEN(p));
vim_free(p);
vim_free(fnames[i]);
}

View File

@@ -54,10 +54,12 @@
/*
* toupper() and tolower() that use the current locale.
* On some systems toupper()/tolower() only work on lower/uppercase characters
* On some systems toupper()/tolower() only work on lower/uppercase
* characters, first use islower() or isupper() then.
* Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
* range 0 - 255. toupper()/tolower() on some systems can't handle others.
* Note: for UTF-8 use utf_toupper() and utf_tolower().
* Note: It is often better to use MB_TOLOWER() and MB_TOUPPER(), because many
* toupper() and tolower() implementations only work for ASCII.
*/
#ifdef MSWIN
# define TOUPPER_LOC(c) toupper_tab[(c) & 255]

View File

@@ -104,7 +104,7 @@ set_indent(size, flags)
int ind_done = 0; /* measured in spaces */
int tab_pad;
int retval = FALSE;
int orig_char_len = 0; /* number of initial whitespace chars when
int orig_char_len = -1; /* number of initial whitespace chars when
'et' and 'pi' are both set */
/*
@@ -159,7 +159,7 @@ set_indent(size, flags)
/* Fill to next tabstop with a tab, if possible */
tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
if (todo >= tab_pad && orig_char_len == 0)
if (todo >= tab_pad && orig_char_len == -1)
{
doit = TRUE;
todo -= tab_pad;
@@ -206,11 +206,15 @@ set_indent(size, flags)
/* If 'preserveindent' and 'expandtab' are both set keep the original
* characters and allocate accordingly. We will fill the rest with spaces
* after the if (!curbuf->b_p_et) below. */
if (orig_char_len != 0)
if (orig_char_len != -1)
{
newline = alloc(orig_char_len + size - ind_done + line_len);
if (newline == NULL)
return FALSE;
todo = size - ind_done;
ind_len = orig_char_len + todo; /* Set total length of indent in
* characters, which may have been
* undercounted until now */
p = oldline;
s = newline;
while (orig_char_len > 0)
@@ -222,9 +226,6 @@ set_indent(size, flags)
* than old) */
while (vim_iswhite(*p))
(void)*p++;
todo = size - ind_done;
ind_len += todo; /* Set total length of indent in characters,
* which may have been undercounted until now */
}
else

View File

@@ -3760,7 +3760,8 @@ add_to_showcmd(c)
extra_len = (int)STRLEN(p);
overflow = old_len + extra_len - SHOWCMD_COLS;
if (overflow > 0)
STRCPY(showcmd_buf, showcmd_buf + overflow);
mch_memmove(showcmd_buf, showcmd_buf + overflow,
old_len - overflow + 1);
STRCAT(showcmd_buf, p);
if (char_avail())

View File

@@ -1727,6 +1727,13 @@ get_syntax_attr(col, can_spell)
{
int attr = 0;
if (can_spell != NULL)
/* Default: Only do spelling when there is no @Spell cluster or when
* ":syn spell toplevel" was used. */
*can_spell = syn_buf->b_syn_spell == SYNSPL_DEFAULT
? (syn_buf->b_spell_cluster_id == 0)
: (syn_buf->b_syn_spell == SYNSPL_TOP);
/* check for out of memory situation */
if (syn_buf->b_sst_array == NULL)
return 0;

View File

@@ -25,7 +25,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test43.out test44.out test45.out test46.out test47.out \
test48.out test51.out test53.out test54.out test55.out \
test56.out test57.out test58.out test59.out test60.out \
test61.out test62.out test63.out
test61.out test62.out test63.out test64.out
.SUFFIXES: .in .out
@@ -108,3 +108,4 @@ test60.out: test60.in
test61.out: test61.in
test62.out: test62.in
test63.out: test63.in
test64.out: test64.in

View File

@@ -19,7 +19,7 @@ SCRIPTS16 = test1.out test19.out test20.out test22.out \
test44.out test45.out test46.out test47.out \
test48.out test51.out test53.out test54.out \
test55.out test56.out test57.out test58.out test59.out \
test60.out test61.out test62.out test63.out
test60.out test61.out test62.out test63.out test64.out
SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test8.out test9.out test11.out test13.out test14.out \
@@ -51,19 +51,19 @@ fixff:
clean:
-del *.out
-del test.ok
-del small.vim
-del tiny.vim
-del mbyte.vim
-if exist test.ok del test.ok
-if exist small.vim del small.vim
-if exist tiny.vim del tiny.vim
-if exist mbyte.vim del mbyte.vim
-del X*
-del viminfo
-if exist viminfo del viminfo
.in.out:
copy $*.ok test.ok
$(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in
diff test.out $*.ok
-del $*.out
-if exist $*.out del $*.out
rename test.out $*.out
-del X*
-del test.ok
-del viminfo
-if exist viminfo del viminfo

View File

@@ -25,7 +25,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test43.out test44.out test45.out test46.out test47.out \
test48.out test51.out test53.out test54.out test55.out \
test56.out test57.out test58.out test59.out test60.out \
test61.out test62.out test63.out
test61.out test62.out test63.out test64.out
.SUFFIXES: .in .out

View File

@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
# Last change: 2007 Jul 24
# Last change: 2007 Aug 14
#
# This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX.
# Edit the lines in the Configuration section below to select.
@@ -59,7 +59,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test43.out test44.out test45.out test46.out \
test48.out test51.out test53.out test54.out test55.out \
test56.out test57.out test58.out test59.out test60.out \
test61.out test62.out test63.out
test61.out test62.out test63.out test64.out
.IFDEF WANT_GUI
SCRIPT_GUI = test16.out

View File

@@ -4,6 +4,10 @@
VIMPROG = ../vim
# Uncomment this line for using valgrind.
# The output goes into a file "valgrind.$PID" (sorry, no test number).
# VALGRIND = valgrind --tool=memcheck --num-callers=15 --logfile=valgrind
SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test7.out test8.out test9.out test10.out test11.out \
test12.out test13.out test14.out test15.out test17.out \
@@ -15,7 +19,8 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test43.out test44.out test45.out test46.out test47.out \
test48.out test49.out test51.out test52.out test53.out \
test54.out test55.out test56.out test57.out test58.out \
test59.out test60.out test61.out test62.out test63.out
test59.out test60.out test61.out test62.out test63.out \
test64.out
SCRIPTS_GUI = test16.out
@@ -38,7 +43,7 @@ clean:
test1.out: test1.in
-rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
$(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
$(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
@/bin/sh -c "if diff test.out $*.ok; \
then mv -f test.out $*.out; \
else echo; \
@@ -51,7 +56,7 @@ test1.out: test1.in
cp $*.ok test.ok
# Sleep a moment to avoid that the xterm title is messed up
@-sleep .2
-$(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
-$(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
@/bin/sh -c "if test -f test.out; then\
if diff test.out $*.ok; \
then mv -f test.out $*.out; \

52
src/testdir/test64.in Normal file
View File

@@ -0,0 +1,52 @@
Test for regexp patterns.
A pattern that gives the expected result produces OK, so that we know it was
actually tried.
STARTTEST
:so small.vim
:" tl is a List of Lists with:
:" regexp pattern
:" text to test the pattern on
:" expected match (optional)
:" expected submatch 1 (optional)
:" expected submatch 2 (optional)
:" etc.
:" When there is no match use only the first two items.
:let tl = []
:call add(tl, ['b', 'abcdef', 'b'])
:call add(tl, ['bc*', 'abccccdef', 'bcccc'])
:call add(tl, ['bc\{-}', 'abccccdef', 'b'])
:call add(tl, ['bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd'])
:call add(tl, ['x', 'abcdef'])
:"
:for t in tl
: let l = matchlist(t[1], t[0])
:" check the match itself
: if len(l) == 0 && len(t) > 2
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", did not match, expected: \"' . t[2] . '\"'
: elseif len(l) > 0 && len(t) == 2
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected no match'
: elseif len(t) > 2 && l[0] != t[2]
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected: \"' . t[2] . '\"'
: else
: $put ='OK'
: endif
: if len(l) > 0
:" check all the nine submatches
: for i in range(1, 9)
: if len(t) <= i + 2
: let e = ''
: else
: let e = t[i + 2]
: endif
: if l[i] != e
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
: endif
: endfor
: endif
:endfor
:/^Results/,$wq! test.out
ENDTEST
Results of test64:

6
src/testdir/test64.ok Normal file
View File

@@ -0,0 +1,6 @@
Results of test64:
OK
OK
OK
OK
OK

View File

@@ -1603,8 +1603,6 @@ set_input_buf(p)
#if defined(FEAT_GUI) || defined(FEAT_MOUSE_GPM) \
|| defined(FEAT_XCLIPBOARD) || defined(VMS) \
|| defined(FEAT_SNIFF) || defined(FEAT_CLIENTSERVER) \
|| (defined(FEAT_GUI) && (!defined(USE_ON_FLY_SCROLL) \
|| defined(FEAT_MENU))) \
|| defined(PROTO)
/*
* Add the given bytes to the input buffer
@@ -1630,7 +1628,9 @@ add_to_input_buf(s, len)
}
#endif
#if (defined(FEAT_XIM) && defined(FEAT_GUI_GTK)) \
#if ((defined(FEAT_XIM) || defined(FEAT_DND)) && defined(FEAT_GUI_GTK)) \
|| defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MAC) \
|| (defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)) \
|| (defined(FEAT_GUI) && (!defined(USE_ON_FLY_SCROLL) \
|| defined(FEAT_MENU))) \

View File

@@ -666,6 +666,26 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
80,
/**/
79,
/**/
78,
/**/
77,
/**/
76,
/**/
75,
/**/
74,
/**/
73,
/**/
72,
/**/
71,
/**/
70,
/**/