Having "search" set in the 'foldopen' option should cause folds to open to show 
a search result after selecting a previous search from the search command line 
history. This works as expected except when there are any CmdwinLeave 
autocommands. In that case, 'KeyTyped' gets reset by the autocommand execution 
and causes the fold not to open. This patch fixes that issue.

-Jake

diff --git a/src/ex_getln.c b/src/ex_getln.c
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -6363,6 +6363,10 @@
 #ifdef FEAT_RIGHTLEFT
     int                        save_cmdmsg_rl = cmdmsg_rl;
 #endif
+#ifdef FEAT_FOLDING
+    int                        save_KeyTyped;
+#endif
+
 
     /* Can't do this recursively.  Can't do it when typing a password. */
     if (cmdwin_type != 0
@@ -6497,8 +6501,19 @@
     RedrawingDisabled = i;
 
 # ifdef FEAT_AUTOCMD
+
+# ifdef FEAT_FOLDING
+    save_KeyTyped = KeyTyped;
+# endif
+
     /* Trigger CmdwinLeave autocommands. */
     apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
+
+# ifdef FEAT_FOLDING
+    /* Restore KeyTyped in case it is modified by autocommands */
+    KeyTyped = save_KeyTyped;
+# endif
+
 # endif
 
     /* Restore the command line info. */

-- 
-- 
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.
diff --git a/src/ex_getln.c b/src/ex_getln.c
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -6363,6 +6363,10 @@
 #ifdef FEAT_RIGHTLEFT
     int			save_cmdmsg_rl = cmdmsg_rl;
 #endif
+#ifdef FEAT_FOLDING
+    int			save_KeyTyped;
+#endif
+
 
     /* Can't do this recursively.  Can't do it when typing a password. */
     if (cmdwin_type != 0
@@ -6497,8 +6501,19 @@
     RedrawingDisabled = i;
 
 # ifdef FEAT_AUTOCMD
+
+# ifdef FEAT_FOLDING
+    save_KeyTyped = KeyTyped;
+# endif
+
     /* Trigger CmdwinLeave autocommands. */
     apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
+
+# ifdef FEAT_FOLDING
+    /* Restore KeyTyped in case it is modified by autocommands */
+    KeyTyped = save_KeyTyped;
+# endif
+
 # endif
 
     /* Restore the command line info. */

Raspunde prin e-mail lui