remove DO_AUTOCHDIR

This commit is contained in:
aph
2014-04-01 19:52:48 +01:00
committed by Thiago de Arruda
parent 94013a73f7
commit 535c450c72
5 changed files with 13 additions and 12 deletions

View File

@@ -425,7 +425,7 @@ aucmd_abort:
return; return;
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR do_autochdir();
/* /*
* Remove the buffer from the list. * Remove the buffer from the list.
@@ -1255,7 +1255,7 @@ void enter_buffer(buf_T *buf)
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR do_autochdir();
if (curbuf->b_kmap_state & KEYMAP_INIT) if (curbuf->b_kmap_state & KEYMAP_INIT)
(void)keymap_init(); (void)keymap_init();
@@ -1272,8 +1272,11 @@ void enter_buffer(buf_T *buf)
*/ */
void do_autochdir(void) void do_autochdir(void)
{ {
if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) if (p_acd) {
if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) {
shorten_fnames(TRUE); shorten_fnames(TRUE);
}
}
} }
/* /*

View File

@@ -2106,7 +2106,7 @@ int rename_buffer(char_u *new_fname)
vim_free(sfname); vim_free(sfname);
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR do_autochdir();
return OK; return OK;
} }
@@ -2303,7 +2303,7 @@ int do_write(exarg_T *eap)
redraw_tabline = TRUE; redraw_tabline = TRUE;
} }
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR do_autochdir();
} }
} }
@@ -3046,7 +3046,7 @@ do_ecmd (
} }
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR do_autochdir();
/* /*
* Careful: open_buffer() and apply_autocmds() may change the current * Careful: open_buffer() and apply_autocmds() may change the current
@@ -3185,7 +3185,7 @@ do_ecmd (
need_start_insertmode = TRUE; need_start_insertmode = TRUE;
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR do_autochdir();
theend: theend:

View File

@@ -184,6 +184,4 @@
# define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1) # define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1)
# define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p)) # define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p))
# define DO_AUTOCHDIR if (p_acd) do_autochdir();
# define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE # define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE

View File

@@ -5351,7 +5351,7 @@ set_bool_option (
p_wiv = (*T_XS != NUL); p_wiv = (*T_XS != NUL);
} else if ((int *)varp == &p_acd) { } else if ((int *)varp == &p_acd) {
/* Change directories when the 'acd' option is set now. */ /* Change directories when the 'acd' option is set now. */
DO_AUTOCHDIR do_autochdir();
} }
/* 'diff' */ /* 'diff' */
else if ((int *)varp == &curwin->w_p_diff) { else if ((int *)varp == &curwin->w_p_diff) {

View File

@@ -3536,7 +3536,7 @@ static void win_enter_ext(win_T *wp, int undo_sync, int curwin_invalid, int trig
setmouse(); /* in case jumped to/from help buffer */ setmouse(); /* in case jumped to/from help buffer */
/* Change directories when the 'acd' option is set. */ /* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR do_autochdir();
} }