diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-04-14 16:22:04 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-04-14 16:22:04 +0200 |
commit | 429fcfbf9a9275367fe9441a50a3dcd773497d84 (patch) | |
tree | 60edefaa455e444f1dbc6f0e38cb7b0d80dd965e /src | |
parent | 8110a091bc749d8748a20807a724a3af3ca6d509 (diff) | |
download | vim-429fcfbf9a9275367fe9441a50a3dcd773497d84.zip |
patch 7.4.1732
Problem: Folds may close when using autocomplete. (Anmol Sethi)
Solution: Increment/decrement disable_fold. (Christian Brabandt, closes
#643)
Diffstat (limited to 'src')
-rw-r--r-- | src/edit.c | 2 | ||||
-rw-r--r-- | src/fold.c | 3 | ||||
-rw-r--r-- | src/globals.h | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 11 insertions, 0 deletions
diff --git a/src/edit.c b/src/edit.c index abe26fbb6..f4a835485 100644 --- a/src/edit.c +++ b/src/edit.c @@ -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 */ diff --git a/src/fold.c b/src/fold.c index e0b2609d9..8b9ca35eb 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_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 diff --git a/src/globals.h b/src/globals.h index 3278ad977..5effdb563 100644 --- a/src/globals.h +++ b/src/globals.h @@ -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); diff --git a/src/version.c b/src/version.c index 04545d969..f1dbb6168 100644 --- a/src/version.c +++ b/src/version.c @@ -749,6 +749,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1732, +/**/ 1731, /**/ 1730, |