]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.753 v7.3.753
authorBram Moolenaar <Bram@vim.org>
Wed, 5 Dec 2012 18:13:18 +0000 (19:13 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 5 Dec 2012 18:13:18 +0000 (19:13 +0100)
Problem:    When there is a QuitPre autocommand using ":q" twice does not work
            for exiting when there are more files to edit.
Solution:   Do not decrement quitmore in an autocommand. (Techlive Zheng)

src/ex_docmd.c
src/fileio.c
src/proto/fileio.pro
src/version.c

index 6c3b6f4e89fbc07ef75591d70c94b1389a958054..d0d9f560598bba2573c6e06be3e5a167df382e30 100644 (file)
@@ -1729,11 +1729,13 @@ do_one_cmd(cmdlinep, sourcing,
     ++ex_nesting_level;
 #endif
 
-       /* when not editing the last file :q has to be typed twice */
+    /* When the last file has not been edited :q has to be typed twice. */
     if (quitmore
 #ifdef FEAT_EVAL
            /* avoid that a function call in 'statusline' does this */
            && !getline_equal(fgetline, cookie, get_func_line)
+           /* avoid that an autocommand, e.g. QuitPre, does this */
+           && !getline_equal(fgetline, cookie, getnextac)
 #endif
            )
        --quitmore;
index a3113d7b198e60f278900c65073284134254740e..470cce2525fc8671d0e916eb5b41157a352d380d 100644 (file)
@@ -7774,7 +7774,6 @@ static char_u *find_end_event __ARGS((char_u *arg, int have_group));
 static int event_ignored __ARGS((event_T event));
 static int au_get_grouparg __ARGS((char_u **argp));
 static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
-static char_u *getnextac __ARGS((int c, void *cookie, int indent));
 static int apply_autocmds_group __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
 static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
 
@@ -9613,7 +9612,7 @@ auto_next_pat(apc, stop_at_last)
  * Called by do_cmdline() to get the next line for ":if".
  * Returns allocated string, or NULL for end of autocommands.
  */
-    static char_u *
+    char_u *
 getnextac(c, cookie, indent)
     int            c UNUSED;
     void    *cookie;
index baf621664643c5d361e11b4d945bab12e1b45298..113b668bdf7cc91bfca4fffb97e5fdb742f878b8 100644 (file)
@@ -47,6 +47,7 @@ int has_cursormovedI __ARGS((void));
 int has_insertcharpre __ARGS((void));
 void block_autocmds __ARGS((void));
 void unblock_autocmds __ARGS((void));
+char_u *getnextac __ARGS((int c, void *cookie, int indent));
 int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
 char_u *get_augroup_name __ARGS((expand_T *xp, int idx));
 char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd));
index 435bff41cca60bea3d7cf4dd76860971240a5a03..1bfaa82d8f2e47e4ab025d3031d4b0e1fd2bd33f 100644 (file)
@@ -725,6 +725,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    753,
 /**/
     752,
 /**/