Hi Anmol!
On Mi, 17 Feb 2016, Anmol Sethi wrote:
> Create a file that looks like this (main.go)
>
> ```go
> package main
>
> import (
> "fmt"
> )
>
> func main() {
> fm
> fmt.Print("lmao")
> }
> ```
>
> Now open it with vim as so
>
> ```zsh
> vim -N -u NONE main.go
> ```
>
> First do `:set foldmethod=indent`
>
> Now type `7jA`. Now press `<c-x><c-l>`. Bam the fold gets closed.
I think, this fixes it:
```patch
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..5731285 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..db98584 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);
```
Best,
Christian
--
Alle sind schon sturzbetrunken, außer Reinhold, der den Wein
holt.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.