Skip to content

Commit bee8023

Browse files
committed
updated for version 7.3.753
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)
1 parent 819e7ff commit bee8023

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/ex_docmd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,11 +1729,13 @@ do_one_cmd(cmdlinep, sourcing,
17291729
++ex_nesting_level;
17301730
#endif
17311731

1732-
/* when not editing the last file :q has to be typed twice */
1732+
/* When the last file has not been edited :q has to be typed twice. */
17331733
if (quitmore
17341734
#ifdef FEAT_EVAL
17351735
/* avoid that a function call in 'statusline' does this */
17361736
&& !getline_equal(fgetline, cookie, get_func_line)
1737+
/* avoid that an autocommand, e.g. QuitPre, does this */
1738+
&& !getline_equal(fgetline, cookie, getnextac)
17371739
#endif
17381740
)
17391741
--quitmore;

src/fileio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7774,7 +7774,6 @@ static char_u *find_end_event __ARGS((char_u *arg, int have_group));
77747774
static int event_ignored __ARGS((event_T event));
77757775
static int au_get_grouparg __ARGS((char_u **argp));
77767776
static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
7777-
static char_u *getnextac __ARGS((int c, void *cookie, int indent));
77787777
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));
77797778
static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
77807779

@@ -9613,7 +9612,7 @@ auto_next_pat(apc, stop_at_last)
96139612
* Called by do_cmdline() to get the next line for ":if".
96149613
* Returns allocated string, or NULL for end of autocommands.
96159614
*/
9616-
static char_u *
9615+
char_u *
96179616
getnextac(c, cookie, indent)
96189617
int c UNUSED;
96199618
void *cookie;

src/proto/fileio.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ int has_cursormovedI __ARGS((void));
4747
int has_insertcharpre __ARGS((void));
4848
void block_autocmds __ARGS((void));
4949
void unblock_autocmds __ARGS((void));
50+
char_u *getnextac __ARGS((int c, void *cookie, int indent));
5051
int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
5152
char_u *get_augroup_name __ARGS((expand_T *xp, int idx));
5253
char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd));

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,8 @@ static char *(features[]) =
725725

726726
static int included_patches[] =
727727
{ /* Add new patch number below this line */
728+
/**/
729+
753,
728730
/**/
729731
752,
730732
/**/

0 commit comments

Comments
 (0)