diff --git a/src/edit.c b/src/edit.c
index d6d31f9..cbca9b6 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1429,8 +1429,10 @@ doESCkey:
 
 docomplete:
 	    compl_busy = TRUE;
+	    disable_fold++;
 	    if (ins_complete(c) == FAIL)
 		compl_cont_status = 0;
+	    disable_fold--;
 	    compl_busy = FALSE;
 	    break;
 #endif /* FEAT_INS_EXPAND */
diff --git a/src/fold.c b/src/fold.c
index e0b2609..3fe20aa 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -811,6 +811,9 @@ foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
 {
     fold_T	*fp;
 
+    if (disable_fold)
+       return;
+
     /* Mark all folds from top to bot as maybe-small. */
     (void)foldFind(&wp->w_folds, top, &fp);
     while (fp < (fold_T *)wp->w_folds.ga_data + wp->w_folds.ga_len
diff --git a/src/globals.h b/src/globals.h
index b43f1a2..9905e70 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1179,6 +1179,10 @@ EXTERN int	fill_fold INIT(= '-');
 EXTERN int	fill_diff INIT(= '-');
 #endif
 
+#ifdef FEAT_FOLDING
+EXTERN int disable_fold INIT(= FALSE);
+#endif
+
 /* Whether 'keymodel' contains "stopsel" and "startsel". */
 EXTERN int	km_stopsel INIT(= FALSE);
 EXTERN int	km_startsel INIT(= FALSE);
