aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 037b5dec7f..4d958b201a 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -7241,7 +7241,7 @@ void free_cd_dir(void)
/// Deal with the side effects of changing the current directory.
///
/// @param scope Scope of the function call (global, tab or window).
-void post_chdir(CdScope scope)
+void post_chdir(CdScope scope, bool trigger_dirchanged)
{
// Always overwrite the window-local CWD.
xfree(curwin->w_localdir);
@@ -7281,7 +7281,10 @@ void post_chdir(CdScope scope)
}
shorten_fnames(true);
- do_autocmd_dirchanged(cwd, scope);
+
+ if (trigger_dirchanged) {
+ do_autocmd_dirchanged(cwd, scope);
+ }
}
/// `:cd`, `:tcd`, `:lcd`, `:chdir`, `:tchdir` and `:lchdir`.
@@ -7340,10 +7343,10 @@ void ex_cd(exarg_T *eap)
break;
}
- if (vim_chdir(new_dir, scope)) {
+ if (vim_chdir(new_dir)) {
EMSG(_(e_failed));
} else {
- post_chdir(scope);
+ post_chdir(scope, true);
// Echo the new current directory if the command was typed.
if (KeyTyped || p_verbose >= 5) {
ex_pwd(eap);
@@ -7804,11 +7807,12 @@ static void ex_redir(exarg_T *eap)
redir_off = FALSE;
}
-/*
- * ":redraw": force redraw
- */
+/// ":redraw": force redraw
static void ex_redraw(exarg_T *eap)
{
+ if (State & CMDPREVIEW) {
+ return; // Ignore :redraw during 'inccommand' preview. #9777
+ }
int r = RedrawingDisabled;
int p = p_lz;
@@ -7837,11 +7841,12 @@ static void ex_redraw(exarg_T *eap)
ui_flush();
}
-/*
- * ":redrawstatus": force redraw of status line(s)
- */
+/// ":redrawstatus": force redraw of status line(s)
static void ex_redrawstatus(exarg_T *eap)
{
+ if (State & CMDPREVIEW) {
+ return; // Ignore :redrawstatus during 'inccommand' preview. #9777
+ }
int r = RedrawingDisabled;
int p = p_lz;