mirror of
https://github.com/vim/vim.git
synced 2025-10-05 05:34:07 -04:00
updated for version 7.4b.008
Problem: 'autochdir' causes setbufvar() to change the current directory. (Ben Fritz) Solution: When disabling autocommands also reset 'acd' temporarily. (Christian Brabandt)
This commit is contained in:
10
src/fileio.c
10
src/fileio.c
@@ -8861,6 +8861,7 @@ aucmd_prepbuf(aco, buf)
|
|||||||
#ifdef FEAT_WINDOWS
|
#ifdef FEAT_WINDOWS
|
||||||
int save_ea;
|
int save_ea;
|
||||||
#endif
|
#endif
|
||||||
|
int save_acd;
|
||||||
|
|
||||||
/* Find a window that is for the new buffer */
|
/* Find a window that is for the new buffer */
|
||||||
if (buf == curbuf) /* be quick when buf is curbuf */
|
if (buf == curbuf) /* be quick when buf is curbuf */
|
||||||
@@ -8909,11 +8910,10 @@ aucmd_prepbuf(aco, buf)
|
|||||||
aucmd_win->w_s = &buf->b_s;
|
aucmd_win->w_s = &buf->b_s;
|
||||||
++buf->b_nwindows;
|
++buf->b_nwindows;
|
||||||
win_init_empty(aucmd_win); /* set cursor and topline to safe values */
|
win_init_empty(aucmd_win); /* set cursor and topline to safe values */
|
||||||
vim_free(aucmd_win->w_localdir);
|
|
||||||
aucmd_win->w_localdir = NULL;
|
|
||||||
|
|
||||||
/* Make sure w_localdir and globaldir are NULL to avoid a chdir() in
|
/* Make sure w_localdir and globaldir are NULL to avoid a chdir() in
|
||||||
* win_enter_ext(). */
|
* win_enter_ext(). */
|
||||||
|
vim_free(aucmd_win->w_localdir);
|
||||||
aucmd_win->w_localdir = NULL;
|
aucmd_win->w_localdir = NULL;
|
||||||
aco->globaldir = globaldir;
|
aco->globaldir = globaldir;
|
||||||
globaldir = NULL;
|
globaldir = NULL;
|
||||||
@@ -8926,9 +8926,15 @@ aucmd_prepbuf(aco, buf)
|
|||||||
make_snapshot(SNAP_AUCMD_IDX);
|
make_snapshot(SNAP_AUCMD_IDX);
|
||||||
save_ea = p_ea;
|
save_ea = p_ea;
|
||||||
p_ea = FALSE;
|
p_ea = FALSE;
|
||||||
|
|
||||||
|
/* Prevent chdir() call in win_enter_ext(), through do_autochdir(). */
|
||||||
|
save_acd = p_acd;
|
||||||
|
p_acd = FALSE;
|
||||||
|
|
||||||
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
|
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
|
||||||
(void)win_comp_pos(); /* recompute window positions */
|
(void)win_comp_pos(); /* recompute window positions */
|
||||||
p_ea = save_ea;
|
p_ea = save_ea;
|
||||||
|
p_acd = save_acd;
|
||||||
unblock_autocmds();
|
unblock_autocmds();
|
||||||
#endif
|
#endif
|
||||||
curwin = aucmd_win;
|
curwin = aucmd_win;
|
||||||
|
@@ -727,6 +727,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
8,
|
||||||
/**/
|
/**/
|
||||||
7,
|
7,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user