]> granicus.if.org Git - vim/commitdiff
patch 7.4.1732 v7.4.1732
authorBram Moolenaar <Bram@vim.org>
Thu, 14 Apr 2016 14:22:04 +0000 (16:22 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 14 Apr 2016 14:22:04 +0000 (16:22 +0200)
Problem:    Folds may close when using autocomplete. (Anmol Sethi)
Solution:   Increment/decrement disable_fold. (Christian Brabandt, closes
            #643)

src/edit.c
src/fold.c
src/globals.h
src/version.c

index abe26fbb64b89ea6333f00b9ade33f25849e3420..f4a835485cb4df42160a4f28564f7c857c006aa7 100644 (file)
@@ -1424,8 +1424,10 @@ doESCkey:
 
 docomplete:
            compl_busy = TRUE;
+           disable_fold_update++;  /* don't redraw folds here */
            if (ins_complete(c, TRUE) == FAIL)
                compl_cont_status = 0;
+           disable_fold_update--;
            compl_busy = FALSE;
            break;
 #endif /* FEAT_INS_EXPAND */
index e0b2609d981303ea515570e1c087f7eb908ab8fe..8b9ca35ebf174fb21613f47df284aecf143bbc5b 100644 (file)
@@ -811,6 +811,9 @@ foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
 {
     fold_T     *fp;
 
+    if (disable_fold_update > 0)
+       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
index 3278ad977568d036ddd411b33b13a11348d1eb4f..5effdb563034ca5b76a209f9e9e1577fb1ae2557 100644 (file)
@@ -1176,6 +1176,10 @@ EXTERN int       fill_fold INIT(= '-');
 EXTERN int     fill_diff INIT(= '-');
 #endif
 
+#ifdef FEAT_FOLDING
+EXTERN int     disable_fold_update INIT(= 0);
+#endif
+
 /* Whether 'keymodel' contains "stopsel" and "startsel". */
 EXTERN int     km_stopsel INIT(= FALSE);
 EXTERN int     km_startsel INIT(= FALSE);
index 04545d9695f15eb7379749e74985c275f278fa92..f1dbb6168a8510983c45b14ac17fe615d2b65053 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1732,
 /**/
     1731,
 /**/