Hi Bram!
On So, 04 Jan 2015, Bram Moolenaar wrote:
> Christian wrote:
>
> > On Fr, 02 Jan 2015, Bram Moolenaar wrote:
> >
> > > Problem is that while typing this will open lots of folds before the one
> > > you actually want to see.
> >
> > Do you fear, that this might slow down Vim too much?
>
> It will open folds that the user might not want opened.
>
> > > Temporarily opening one fold would be better,
> > > but might be a bit difficult to implement.
> >
> > Like temporarily setting foldclose setting?
>
> I don't think that changing an option is a good solution, it may have
> unexpected side effects.
Here is a patch, that temporarily resets the foldclose setting. This
avoids leaving some folds open. As far as my testing have shown, this
closes all matches after moving the cursor away, even when getting an
interrupt.
> Yes. Would require redrawing from the matching line to the end of the
> window, and again when the match changes position. This happens anyway
> when the text scrolls more than a few lines.
One might miss some context in that case.
Best,
Christian
--
Ein Virus kommt selten allein.
--
--
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
@@ -1843,10 +1843,25 @@ cmdline_changed:
validate_cursor();
end_pos = curwin->w_cursor;
curwin->w_cursor = save_pos;
+#ifdef FEAT_FOLDING
+ if (fdo_flags & FDO_SEARCH)
+ foldOpenCursor();
+#endif
}
else
end_pos = curwin->w_cursor; /* shutup gcc 4 */
+#ifdef FEAT_FOLDING
+ if (fdo_flags & FDO_SEARCH)
+ {
+ char_u *saved_fcl = p_fcl;
+
+ p_fcl = (char_u *)"a";
+ foldCheckClose();
+ p_fcl = saved_fcl;
+ }
+#endif
+
validate_cursor();
# ifdef FEAT_WINDOWS
/* May redraw the status line to show the cursor position. */
@@ -1910,6 +1925,17 @@ returncmd:
# endif
curwin->w_botline = old_botline;
highlight_match = FALSE;
+#ifdef FEAT_FOLDING
+
+ if (fdo_flags & FDO_SEARCH)
+ {
+ char_u *saved_fcl = p_fcl;
+
+ p_fcl = (char_u *)"a";
+ foldCheckClose();
+ p_fcl = saved_fcl;
+ }
+#endif
validate_cursor(); /* needed for TAB */
redraw_later(SOME_VALID);
}