Permalink
Browse files

Merged from the latest developing branch.

git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@1604 2a77ed30-b011-0410-a7ad-c7884a0aa172
  • Loading branch information...
1 parent 2944a4d commit cce287e02577075d5883f7670fcd10cbdad55a47 edyfox committed Sep 12, 2009
Showing with 89 additions and 19 deletions.
  1. +5 −9 src/fileio.c
  2. +3 −5 src/gui_gtk_f.c
  3. +6 −0 src/gui_gtk_x11.c
  4. +18 −0 src/option.c
  5. +1 −1 src/testdir/Makefile
  6. +33 −0 src/testdir/test67.in
  7. +10 −0 src/testdir/test67.ok
  8. +3 −4 src/ui.c
  9. +10 −0 src/version.c
View
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
View
@@ -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
+
View
@@ -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
@@ -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
@@ -676,6 +676,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 259,
+/**/
+ 258,
+/**/
+ 257,
+/**/
+ 256,
+/**/
+ 255,
/**/
254,
/**/

0 comments on commit cce287e

Please sign in to comment.