Compare commits

...

15 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
Bram Moolenaar
2b80e65818 updated for version 7.1-070 2007-08-14 14:57:55 +00:00
Bram Moolenaar
d2c765e688 updated for version 7.1-069 2007-08-14 13:00:40 +00:00
Bram Moolenaar
67f7131efa updated for version 7.1-068 2007-08-12 14:55:56 +00:00
Bram Moolenaar
a2993e1340 updated for version 7.1-067 2007-08-12 14:38:46 +00:00
Bram Moolenaar
83eb885d54 updated for version 7.1-066 2007-08-12 13:51:26 +00:00
28 changed files with 398 additions and 103 deletions

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.1. Last change: 2007 May 11
*options.txt* For Vim version 7.1. Last change: 2007 Aug 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2415,8 +2415,8 @@ A jump table for the options with a short description can be found at |Q_op|.
When mixing vertically and horizontally split windows, a minimal size
is computed and some windows may be larger if there is room. The
'eadirection' option tells in which direction the size is affected.
Changing the height of a window can be avoided by setting
'winfixheight'.
Changing the height and width of a window can be avoided by setting
'winfixheight' and 'winfixwidth', respectively.
*'equalprg'* *'ep'*
'equalprg' 'ep' string (default "")

View File

@@ -132,7 +132,8 @@ CTRL-W CTRL-S *CTRL-W_CTRL-S*
the same file. Make new window N high (default is to use half
the height of the current window). Reduces the current window
height to create room (and others, if the 'equalalways' option
is set and 'eadirection' isn't "hor").
is set, 'eadirection' isn't "hor", and one of them is higher
than the current or the new window).
Note: CTRL-S does not work on all terminals and might block
further input, use CTRL-Q to get going again.
Also see |++opt| and |+cmd|.
@@ -140,9 +141,13 @@ CTRL-W CTRL-S *CTRL-W_CTRL-S*
CTRL-W CTRL-V *CTRL-W_CTRL-V*
CTRL-W v *CTRL-W_v*
:[N]vs[plit] [++opt] [+cmd] [file] *:vs* *:vsplit*
Like |:split|, but split vertically. If 'equalalways' is set
and 'eadirection' isn't "ver" the windows will be spread out
horizontally, unless a width was specified.
Like |:split|, but split vertically. The windows will be
spread out horizontally if
1. a width was not specified,
2. 'equalalways' is set,
3. 'eadirection' isn't "ver", and
4. one of the other windows are wider than the current or new
window.
Note: In other places CTRL-Q does the same as CTRL-V, but here
it doesn't!

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

@@ -502,6 +502,7 @@ buf_clear_file(buf)
buf->b_start_eol = TRUE;
#ifdef FEAT_MBYTE
buf->b_p_bomb = FALSE;
buf->b_start_bomb = FALSE;
#endif
buf->b_ml.ml_mfp = NULL;
buf->b_ml.ml_flags = ML_EMPTY; /* empty buffer */

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

@@ -2057,7 +2057,6 @@ vim_is_ctrl_x_key(c)
* case of the originally typed text is used, and the case of the completed
* text is inferred, ie this tries to work out what case you probably wanted
* the rest of the word to be in -- webb
* TODO: make this work for multi-byte characters.
*/
int
ins_compl_add_infercase(str, len, icase, fname, dir, flags)
@@ -2068,54 +2067,147 @@ ins_compl_add_infercase(str, len, icase, fname, dir, flags)
int dir;
int flags;
{
char_u *p;
int i, c;
int actual_len; /* Take multi-byte characters */
int actual_compl_length; /* into account. */
int *wca; /* Wide character array. */
int has_lower = FALSE;
int was_letter = FALSE;
int idx;
if (p_ic && curbuf->b_p_inf && len < IOSIZE)
if (p_ic && curbuf->b_p_inf)
{
/* Infer case of completed part -- webb */
/* Use IObuff, str would change text in buffer! */
vim_strncpy(IObuff, str, len);
/* Infer case of completed part. */
/* Rule 1: Were any chars converted to lower? */
for (idx = 0; idx < compl_length; ++idx)
/* Find actual length of completion. */
#ifdef FEAT_MBYTE
if (has_mbyte)
{
if (islower(compl_orig_text[idx]))
p = str;
actual_len = 0;
while (*p != NUL)
{
has_lower = TRUE;
if (isupper(IObuff[idx]))
{
/* Rule 1 is satisfied */
for (idx = compl_length; idx < len; ++idx)
IObuff[idx] = TOLOWER_LOC(IObuff[idx]);
break;
}
mb_ptr_adv(p);
++actual_len;
}
}
else
#endif
actual_len = len;
/*
* Rule 2: No lower case, 2nd consecutive letter converted to
* upper case.
*/
if (!has_lower)
/* Find actual length of original text. */
#ifdef FEAT_MBYTE
if (has_mbyte)
{
for (idx = 0; idx < compl_length; ++idx)
p = compl_orig_text;
actual_compl_length = 0;
while (*p != NUL)
{
if (was_letter && isupper(compl_orig_text[idx])
&& islower(IObuff[idx]))
{
/* Rule 2 is satisfied */
for (idx = compl_length; idx < len; ++idx)
IObuff[idx] = TOUPPER_LOC(IObuff[idx]);
break;
}
was_letter = isalpha(compl_orig_text[idx]);
mb_ptr_adv(p);
++actual_compl_length;
}
}
else
#endif
actual_compl_length = compl_length;
/* Copy the original case of the part we typed */
STRNCPY(IObuff, compl_orig_text, compl_length);
/* Allocate wide character array for the completion and fill it. */
wca = (int *)alloc(actual_len * sizeof(int));
if (wca != NULL)
{
p = str;
for (i = 0; i < actual_len; ++i)
#ifdef FEAT_MBYTE
if (has_mbyte)
wca[i] = mb_ptr2char_adv(&p);
else
#endif
wca[i] = *(p++);
/* Rule 1: Were any chars converted to lower? */
p = compl_orig_text;
for (i = 0; i < actual_compl_length; ++i)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_ptr2char_adv(&p);
else
#endif
c = *(p++);
if (MB_ISLOWER(c))
{
has_lower = TRUE;
if (MB_ISUPPER(wca[i]))
{
/* Rule 1 is satisfied. */
for (i = actual_compl_length; i < actual_len; ++i)
wca[i] = MB_TOLOWER(wca[i]);
break;
}
}
}
/*
* Rule 2: No lower case, 2nd consecutive letter converted to
* upper case.
*/
if (!has_lower)
{
p = compl_orig_text;
for (i = 0; i < actual_compl_length; ++i)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_ptr2char_adv(&p);
else
#endif
c = *(p++);
if (was_letter && MB_ISUPPER(c) && MB_ISLOWER(wca[i]))
{
/* Rule 2 is satisfied. */
for (i = actual_compl_length; i < actual_len; ++i)
wca[i] = MB_TOUPPER(wca[i]);
break;
}
was_letter = MB_ISLOWER(c) || MB_ISUPPER(c);
}
}
/* Copy the original case of the part we typed. */
p = compl_orig_text;
for (i = 0; i < actual_compl_length; ++i)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_ptr2char_adv(&p);
else
#endif
c = *(p++);
if (MB_ISLOWER(c))
wca[i] = MB_TOLOWER(wca[i]);
else if (MB_ISUPPER(c))
wca[i] = MB_TOUPPER(wca[i]);
}
/*
* Generate encoding specific output from wide character array.
* Multi-byte characters can occupy up to five bytes more than
* ASCII characters, and we also need one byte for NUL, so stay
* six bytes away from the edge of IObuff.
*/
p = IObuff;
i = 0;
while (i < actual_len && (p - IObuff + 6) < IOSIZE)
#ifdef FEAT_MBYTE
if (has_mbyte)
p += mb_char2bytes(wca[i++], p);
else
#endif
*(p++) = wca[i++];
*p = NUL;
vim_free(wca);
}
return ins_compl_add(IObuff, len, icase, fname, NULL, dir,
flags, FALSE);
@@ -2842,6 +2934,7 @@ ins_compl_files(count, files, thesaurus, flags, regmatch, buf, dir)
/*
* Add the other matches on the line
*/
ptr = buf;
while (!got_int)
{
/* Find start of the next word. Skip white
@@ -2851,7 +2944,7 @@ ins_compl_files(count, files, thesaurus, flags, regmatch, buf, dir)
break;
wstart = ptr;
/* Find end of the word and add it. */
/* Find end of the word. */
#ifdef FEAT_MBYTE
if (has_mbyte)
/* Japanese words may have characters in
@@ -2868,9 +2961,12 @@ ins_compl_files(count, files, thesaurus, flags, regmatch, buf, dir)
else
#endif
ptr = find_word_end(ptr);
add_r = ins_compl_add_infercase(wstart,
(int)(ptr - wstart),
p_ic, files[i], *dir, 0);
/* Add the word. Skip the regexp match. */
if (wstart != regmatch->startp[0])
add_r = ins_compl_add_infercase(wstart,
(int)(ptr - wstart),
p_ic, files[i], *dir, 0);
}
}
if (add_r == OK)

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

@@ -654,6 +654,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
curbuf->b_start_eol = TRUE;
#ifdef FEAT_MBYTE
curbuf->b_p_bomb = FALSE;
curbuf->b_start_bomb = FALSE;
#endif
}
@@ -912,7 +913,10 @@ retry:
file_rewind = FALSE;
#ifdef FEAT_MBYTE
if (set_options)
{
curbuf->b_p_bomb = FALSE;
curbuf->b_start_bomb = FALSE;
}
conv_error = 0;
#endif
}
@@ -1361,7 +1365,10 @@ retry:
size -= blen;
mch_memmove(ptr, ptr + blen, (size_t)size);
if (set_options)
{
curbuf->b_p_bomb = TRUE;
curbuf->b_start_bomb = TRUE;
}
}
if (fio_flags == FIO_UCSBOM)

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

@@ -1630,11 +1630,14 @@ dlg_button_clicked(GtkWidget * widget, ButtonData *data)
*/
/*ARGSUSED*/
static int
dlg_key_press_event(GtkWidget * widget, GdkEventKey * event, CancelData *data)
dlg_key_press_event(GtkWidget *widget, GdkEventKey *event, CancelData *data)
{
/* Ignore hitting Enter when there is no default button. */
if (data->ignore_enter && event->keyval == GDK_Return)
/* Ignore hitting Enter (or Space) when there is no default button. */
if (data->ignore_enter && (event->keyval == GDK_Return
|| event->keyval == ' '))
return TRUE;
else /* A different key was pressed, return to normal behavior */
data->ignore_enter = FALSE;
if (event->keyval != GDK_Escape && event->keyval != GDK_Return)
return FALSE;
@@ -2224,6 +2227,13 @@ dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
DialogInfo *di = (DialogInfo *)data;
/* Ignore hitting Enter (or Space) when there is no default button. */
if (di->ignore_enter && (event->keyval == GDK_Return
|| event->keyval == ' '))
return TRUE;
else /* A different key was pressed, return to normal behavior */
di->ignore_enter = FALSE;
/* Close the dialog when hitting "Esc". */
if (event->keyval == GDK_Escape)
{

View File

@@ -2894,6 +2894,10 @@ dialog_callback(
(void)SetFocus(hwnd);
if (dialog_default_button > IDCANCEL)
(void)SetFocus(GetDlgItem(hwnd, dialog_default_button));
else
/* We don't have a default, set focus on another element of the
* dialog window, probably the icon */
(void)SetFocus(GetDlgItem(hwnd, DLG_NONBUTTON_CONTROL));
return FALSE;
}

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

@@ -7118,6 +7118,11 @@ set_bool_option(opt_idx, varp, value, opt_flags)
/* when 'endofline' is changed, redraw the window title */
else if ((int *)varp == &curbuf->b_p_eol)
need_maketitle = TRUE;
#ifdef FEAT_MBYTE
/* when 'bomb' is changed, redraw the window title */
else if ((int *)varp == &curbuf->b_p_bomb)
need_maketitle = TRUE;
#endif
#endif
/* when 'bin' is set also set some other options */
@@ -10604,6 +10609,8 @@ save_file_ff(buf)
buf->b_start_ffc = *buf->b_p_ff;
buf->b_start_eol = buf->b_p_eol;
#ifdef FEAT_MBYTE
buf->b_start_bomb = buf->b_p_bomb;
/* Only use free/alloc when necessary, they take time. */
if (buf->b_start_fenc == NULL
|| STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0)
@@ -10617,7 +10624,8 @@ save_file_ff(buf)
/*
* Return TRUE if 'fileformat' and/or 'fileencoding' has a different value
* from when editing started (save_file_ff() called).
* Also when 'endofline' was changed and 'binary' is set.
* Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
* changed and 'binary' is not set.
* Don't consider a new, empty buffer to be changed.
*/
int
@@ -10636,6 +10644,8 @@ file_ff_differs(buf)
if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol)
return TRUE;
#ifdef FEAT_MBYTE
if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb)
return TRUE;
if (buf->b_start_fenc == NULL)
return (*buf->b_p_fenc != NUL);
return (STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0);

View File

@@ -1453,6 +1453,7 @@ struct file_buffer
#ifdef FEAT_MBYTE
char_u *b_start_fenc; /* 'fileencoding' when edit started or NULL */
int b_bad_char; /* "++bad=" argument when edit started or 0 */
int b_start_bomb; /* 'bomb' when it was read */
#endif
#ifdef FEAT_EVAL

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,36 @@ 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,
/**/
69,
/**/
68,
/**/
67,
/**/
66,
/**/
65,
/**/

View File

@@ -733,7 +733,6 @@ win_split_ins(size, flags, newwin, dir)
if (flags & WSP_VERT)
{
layout = FR_ROW;
do_equal = (p_ea && new_size == 0 && *p_ead != 'v');
/*
* Check if we are able to split the current window and compute its
@@ -770,16 +769,31 @@ win_split_ins(size, flags, newwin, dir)
* instead, if possible. */
if (oldwin->w_p_wfw)
win_setwidth_win(oldwin->w_width + new_size, oldwin);
/* Only make all windows the same width if one of them (except oldwin)
* is wider than one of the split windows. */
if (!do_equal && p_ea && size == 0 && *p_ead != 'v'
&& oldwin->w_frame->fr_parent != NULL)
{
frp = oldwin->w_frame->fr_parent->fr_child;
while (frp != NULL)
{
if (frp->fr_win != oldwin && frp->fr_win != NULL
&& (frp->fr_win->w_width > new_size
|| frp->fr_win->w_width > oldwin->w_width
- new_size - STATUS_HEIGHT))
{
do_equal = TRUE;
break;
}
frp = frp->fr_next;
}
}
}
else
#endif
{
layout = FR_COL;
do_equal = (p_ea && new_size == 0
#ifdef FEAT_VERTSPLIT
&& *p_ead != 'h'
#endif
);
/*
* Check if we are able to split the current window and compute its
@@ -832,6 +846,29 @@ win_split_ins(size, flags, newwin, dir)
if (need_status)
oldwin_height -= STATUS_HEIGHT;
}
/* Only make all windows the same height if one of them (except oldwin)
* is higher than one of the split windows. */
if (!do_equal && p_ea && size == 0
#ifdef FEAT_VERTSPLIT
&& *p_ead != 'h'
#endif
&& oldwin->w_frame->fr_parent != NULL)
{
frp = oldwin->w_frame->fr_parent->fr_child;
while (frp != NULL)
{
if (frp->fr_win != oldwin && frp->fr_win != NULL
&& (frp->fr_win->w_height > new_size
|| frp->fr_win->w_height > oldwin_height - new_size
- STATUS_HEIGHT))
{
do_equal = TRUE;
break;
}
frp = frp->fr_next;
}
}
}
/*