Compare commits

...

4 Commits

Author SHA1 Message Date
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
8 changed files with 69 additions and 19 deletions

View File

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

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

@@ -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,14 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
259,
/**/
258,
/**/
257,
/**/
256,
/**/
255,
/**/