mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 14:58:18 +00:00
remove DO_AUTOCHDIR
This commit is contained in:
11
src/buffer.c
11
src/buffer.c
@@ -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) {
|
||||||
shorten_fnames(TRUE);
|
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);
|
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:
|
||||||
|
@@ -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
|
||||||
|
@@ -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) {
|
||||||
|
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user