diff options
-rw-r--r-- | src/buffer.c | 11 | ||||
-rw-r--r-- | src/ex_cmds.c | 8 | ||||
-rw-r--r-- | src/macros.h | 2 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/window.c | 2 |
5 files changed, 13 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c index 5c77f85506..93f5fce8aa 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -425,7 +425,7 @@ aucmd_abort: return; /* Change directories when the 'acd' option is set. */ - DO_AUTOCHDIR + do_autochdir(); /* * Remove the buffer from the list. @@ -1255,7 +1255,7 @@ void enter_buffer(buf_T *buf) /* Change directories when the 'acd' option is set. */ - DO_AUTOCHDIR + do_autochdir(); if (curbuf->b_kmap_state & KEYMAP_INIT) (void)keymap_init(); @@ -1272,8 +1272,11 @@ void enter_buffer(buf_T *buf) */ void do_autochdir(void) { - if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) - shorten_fnames(TRUE); + if (p_acd) { + if (curbuf->b_ffname != NULL && vim_chdirfile(curbuf->b_ffname) == OK) { + shorten_fnames(TRUE); + } + } } /* diff --git a/src/ex_cmds.c b/src/ex_cmds.c index b2656a98a9..cf002511c4 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2106,7 +2106,7 @@ int rename_buffer(char_u *new_fname) vim_free(sfname); apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); /* Change directories when the 'acd' option is set. */ - DO_AUTOCHDIR + do_autochdir(); return OK; } @@ -2303,7 +2303,7 @@ int do_write(exarg_T *eap) redraw_tabline = TRUE; } /* 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. */ - DO_AUTOCHDIR + do_autochdir(); /* * Careful: open_buffer() and apply_autocmds() may change the current @@ -3185,7 +3185,7 @@ do_ecmd ( need_start_insertmode = TRUE; /* Change directories when the 'acd' option is set. */ - DO_AUTOCHDIR + do_autochdir(); theend: diff --git a/src/macros.h b/src/macros.h index 361f5a0421..8199dd41a3 100644 --- a/src/macros.h +++ b/src/macros.h @@ -184,6 +184,4 @@ # define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1) # 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 diff --git a/src/option.c b/src/option.c index fbc577293f..dc3191d0b1 100644 --- a/src/option.c +++ b/src/option.c @@ -5351,7 +5351,7 @@ set_bool_option ( p_wiv = (*T_XS != NUL); } else if ((int *)varp == &p_acd) { /* Change directories when the 'acd' option is set now. */ - DO_AUTOCHDIR + do_autochdir(); } /* 'diff' */ else if ((int *)varp == &curwin->w_p_diff) { diff --git a/src/window.c b/src/window.c index 2ea8a29084..699114978b 100644 --- a/src/window.c +++ b/src/window.c @@ -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 */ /* Change directories when the 'acd' option is set. */ - DO_AUTOCHDIR + do_autochdir(); } |