Compare commits

...

14 Commits

Author SHA1 Message Date
Bram Moolenaar
67b891e16c updated for version 7.2-262 2009-09-18 15:25:52 +00:00
Bram Moolenaar
194b94c5a8 updated for version 7.2-261 2009-09-18 13:17:09 +00:00
Bram Moolenaar
2db24dc29b updated for version 7.2-260 2009-09-18 12:59:26 +00:00
Bram Moolenaar
5b7880dea2 updated for version 7.2-259 2009-09-11 15:24:31 +00:00
Bram Moolenaar
86c800a1b3 updated for version 7.2-258 2009-09-11 14:48:27 +00:00
Bram Moolenaar
5e69de4421 updated for version 7.2-257 2009-09-11 14:17:54 +00:00
Bram Moolenaar
bef9d835f5 updated for version 7.2-256 2009-09-11 13:46:41 +00:00
Bram Moolenaar
319bdbd5ef updated for version 7.2-255 2009-09-11 13:20:33 +00:00
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
23 changed files with 161 additions and 48 deletions

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,

2
src/auto/configure vendored
View File

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

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

@@ -3266,7 +3266,6 @@ nextwild(xp, type, options)
int i, j;
char_u *p1;
char_u *p2;
int oldlen;
int difflen;
int v;
@@ -3291,7 +3290,7 @@ nextwild(xp, type, options)
out_flush();
i = (int)(xp->xp_pattern - ccline.cmdbuff);
oldlen = ccline.cmdpos - i;
xp->xp_pattern_len = ccline.cmdpos - i;
if (type == WILD_NEXT || type == WILD_PREV)
{
@@ -3305,18 +3304,20 @@ nextwild(xp, type, options)
/*
* Translate string into pattern and expand it.
*/
if ((p1 = addstar(&ccline.cmdbuff[i], oldlen, xp->xp_context)) == NULL)
if ((p1 = addstar(xp->xp_pattern, xp->xp_pattern_len,
xp->xp_context)) == NULL)
p2 = NULL;
else
{
p2 = ExpandOne(xp, p1, vim_strnsave(&ccline.cmdbuff[i], oldlen),
p2 = ExpandOne(xp, p1,
vim_strnsave(&ccline.cmdbuff[i], xp->xp_pattern_len),
WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
|options, type);
vim_free(p1);
/* longest match: make sure it is not shorter (happens with :help */
if (p2 != NULL && type == WILD_LONGEST)
{
for (j = 0; j < oldlen; ++j)
for (j = 0; j < xp->xp_pattern_len; ++j)
if (ccline.cmdbuff[i + j] == '*'
|| ccline.cmdbuff[i + j] == '?')
break;
@@ -3331,7 +3332,7 @@ nextwild(xp, type, options)
if (p2 != NULL && !got_int)
{
difflen = (int)STRLEN(p2) - oldlen;
difflen = (int)STRLEN(p2) - xp->xp_pattern_len;
if (ccline.cmdlen + difflen > ccline.cmdbufflen - 4)
{
v = realloc_cmdbuff(ccline.cmdlen + difflen);
@@ -3620,6 +3621,7 @@ ExpandInit(xp)
expand_T *xp;
{
xp->xp_pattern = NULL;
xp->xp_pattern_len = 0;
xp->xp_backslash = XP_BS_NONE;
#ifndef BACKSLASH_IN_FILENAME
xp->xp_shell = FALSE;
@@ -4311,8 +4313,8 @@ expand_cmdline(xp, str, col, matchcount, matches)
}
/* add star to file name, or convert to regexp if not exp. files. */
file_str = addstar(xp->xp_pattern,
(int)(str + col - xp->xp_pattern), xp->xp_context);
xp->xp_pattern_len = (int)(str + col - xp->xp_pattern);
file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context);
if (file_str == NULL)
return EXPAND_UNSUCCESSFUL;
@@ -4781,7 +4783,7 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
sprintf((char *)num, "%d", ccline.cmdpos);
args[1] = ccline.cmdbuff;
}
args[0] = xp->xp_pattern;
args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len);
args[2] = num;
/* Save the cmdline, we don't know what the function may do. */
@@ -4797,6 +4799,7 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
if (ccline.cmdbuff != NULL)
ccline.cmdbuff[ccline.cmdlen] = keep;
vim_free(args[0]);
return ret;
}

View File

@@ -4568,7 +4568,7 @@ restore_backup:
c = TRUE;
if (write_info.bw_conv_error_lnum != 0)
{
int l = STRLEN(IObuff);
size_t l = STRLEN(IObuff);
vim_snprintf((char *)IObuff + l, IOSIZE - l, _(" in line %ld;"),
(long)write_info.bw_conv_error_lnum);
}
@@ -9498,15 +9498,10 @@ au_exists(arg)
ap = first_autopat[(int)event];
if (ap == NULL)
goto theend;
if (pattern == NULL)
{
retval = TRUE;
goto theend;
}
/* if pattern is "<buffer>", special handling is needed which uses curbuf */
/* for pattern "<buffer=N>, fnamecmp() will work fine */
if (STRICMP(pattern, "<buffer>") == 0)
if (pattern != NULL && STRICMP(pattern, "<buffer>") == 0)
buflocal_buf = curbuf;
/* Check if there is an autocommand with the given pattern. */
@@ -9515,9 +9510,10 @@ au_exists(arg)
/* For buffer-local autocommands, fnamecmp() works fine. */
if (ap->pat != NULL && ap->cmds != NULL
&& (group == AUGROUP_ALL || ap->group == group)
&& (buflocal_buf == NULL
? fnamecmp(ap->pat, pattern) == 0
: ap->buflocal_nr == buflocal_buf->b_fnum))
&& (pattern == NULL
|| (buflocal_buf == NULL
? fnamecmp(ap->pat, pattern) == 0
: ap->buflocal_nr == buflocal_buf->b_fnum)))
{
retval = TRUE;
break;

View File

@@ -1607,11 +1607,11 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
}
else
{
/* 2, 3, or 5: need to correct nested folds too */
foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
line2 - fp->fd_top, amount, amount_after);
if (fp->fd_top < top)
{
/* 2 or 3: need to correct nested folds too */
foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
line2 - fp->fd_top, amount, amount_after);
if (last <= line2)
{
/* 2. fold contains line1, line2 is below fold */
@@ -1628,7 +1628,11 @@ foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
}
else
{
/* 5. fold is below line1 and contains line2 */
/* 5. fold is below line1 and contains line2; need to
* correct nested folds too */
foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
line2 - fp->fd_top, amount,
amount_after + (fp->fd_top - top));
if (amount == MAXLNUM)
{
fp->fd_len -= line2 - fp->fd_top + 1;

View File

@@ -860,11 +860,9 @@ gtk_form_main_filter(GdkXEvent *gdk_xevent,
gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
{
#ifdef HAVE_GTK2
gboolean static_gravity_supported;
static_gravity_supported = gdk_window_set_static_gravities(window,
use_static);
g_return_if_fail(static_gravity_supported);
/* We don't check if static gravity is actually supported, because it
* results in an annoying assertion error message. */
gdk_window_set_static_gravities(window, use_static);
#else
XSetWindowAttributes xattributes;

View File

@@ -4729,6 +4729,9 @@ gui_mch_font_dialog(char_u *oldval)
if (oldval != NULL && *oldval != NUL)
gtk_font_selection_dialog_set_font_name(
GTK_FONT_SELECTION_DIALOG(gui.fontdlg), (char *)oldval);
else
gtk_font_selection_dialog_set_font_name(
GTK_FONT_SELECTION_DIALOG(gui.fontdlg), DEFAULT_FONT);
if (gui.fontname)
{
@@ -4816,6 +4819,9 @@ gui_mch_font_dialog(char_u *oldval)
if (oldname != oldval)
vim_free(oldname);
}
else
gtk_font_selection_dialog_set_font_name(
GTK_FONT_SELECTION_DIALOG(dialog), DEFAULT_FONT);
response = gtk_dialog_run(GTK_DIALOG(dialog));

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

@@ -7430,6 +7430,8 @@ set_bool_option(opt_idx, varp, value, opt_flags)
{
if (curwin->w_p_wrap)
curwin->w_leftcol = 0;
if (curwin->w_curswant != MAXCOL)
curwin->w_set_curswant = TRUE;
}
#ifdef FEAT_WINDOWS
@@ -7664,6 +7666,22 @@ set_bool_option(opt_idx, varp, value, opt_flags)
}
#endif
#ifdef FEAT_LINEBREAK
if ((int *)varp == &curwin->w_p_lbr)
{
if (curwin->w_curswant != MAXCOL)
curwin->w_set_curswant = TRUE;
}
#endif
#ifdef FEAT_RIGHTLEFT
if ((int *)varp == &curwin->w_p_rl)
{
if (curwin->w_curswant != MAXCOL)
curwin->w_set_curswant = TRUE;
}
#endif
/*
* End of handling side effects for bool options.
*/

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

@@ -432,6 +432,7 @@ typedef struct expand
{
int xp_context; /* type of expansion */
char_u *xp_pattern; /* start of item to expand */
int xp_pattern_len; /* bytes in xp_pattern before cursor */
#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
char_u *xp_arg; /* completion function */
int xp_scriptID; /* SID for completion function */

View File

@@ -26,7 +26,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.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 test64.out test65.out \
test66.out
test66.out test67.out
.SUFFIXES: .in .out
@@ -112,3 +112,4 @@ test63.out: test63.in
test64.out: test64.in
test65.out: test65.in
test66.out: test66.in
test67.out: test67.in

View File

@@ -26,7 +26,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test15.out test17.out test18.out test21.out test26.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
test42.out test52.out test65.out test66.out
test42.out test52.out test65.out test66.out test67.out
SCRIPTS32 = test50.out

View File

@@ -45,7 +45,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test15.out test17.out test18.out test21.out test26.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
test42.out test52.out test65.out test66.out
test42.out test52.out test65.out test66.out test67.out
SCRIPTS32 = test50.out

View File

@@ -26,7 +26,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.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 test64.out test65.out \
test66.out
test66.out test67.out
.SUFFIXES: .in .out

View File

@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
# Last change: 2009 Mar 05
# Last change: 2009 Sep 11
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -69,7 +69,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test48.out test51.out test53.out test54.out test55.out \
test56.out test57.out test60.out \
test61.out test62.out test63.out test64.out test65.out \
test66.out
test66.out test67.out
.IFDEF WANT_GUI
SCRIPT_GUI = test16.out

View File

@@ -22,7 +22,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.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 \
test64.out test65.out test66.out
test64.out test65.out test66.out test67.out
SCRIPTS_GUI = test16.out

33
src/testdir/test67.in Normal file
View File

@@ -0,0 +1,33 @@
Test that groups and patterns are tested correctly when calling exists() for
autocommands.
STARTTEST
:so small.vim
:let results=[]
:augroup auexists
:augroup END
:call add(results, "##BufEnter: " . exists("##BufEnter"))
:call add(results, "#BufEnter: " . exists("#BufEnter"))
:au BufEnter * let g:entered=1
:call add(results, "#BufEnter: " . exists("#BufEnter"))
:call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter"))
:augroup auexists
:au BufEnter * let g:entered=1
:augroup END
:call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter"))
:call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test"))
:au BufEnter *.test let g:entered=1
:call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test"))
:edit testfile.test
:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
:au BufEnter <buffer> let g:entered=1
:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
:edit testfile2.test
:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
:e test.out
:call append(0, results)
:$d
:w
:qa!
ENDTEST

10
src/testdir/test67.ok Normal file
View File

@@ -0,0 +1,10 @@
##BufEnter: 1
#BufEnter: 0
#BufEnter: 1
#auexists#BufEnter: 0
#auexists#BufEnter: 1
#BufEnter#*.test: 0
#BufEnter#*.test: 1
#BufEnter#<buffer>: 0
#BufEnter#<buffer>: 1
#BufEnter#<buffer>: 0

View File

@@ -3055,18 +3055,17 @@ vcol2col(wp, lnum, vcol)
int vcol;
{
/* try to advance to the specified column */
int col = 0;
int count = 0;
char_u *ptr;
char_u *start;
ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
while (count <= vcol && *ptr != NUL)
{
++col;
count += win_lbr_chartabsize(wp, ptr, count, NULL);
mb_ptr_adv(ptr);
}
return col;
return (int)(ptr - start);
}
#endif

View File

@@ -676,6 +676,34 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
262,
/**/
261,
/**/
260,
/**/
259,
/**/
258,
/**/
257,
/**/
256,
/**/
255,
/**/
254,
/**/
253,
/**/
252,
/**/
251,
/**/
250,
/**/
249,
/**/
248,
/**/