mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
remove DO_AUTOCHDIR
This commit is contained in:
parent
94013a73f7
commit
535c450c72
11
src/buffer.c
11
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user