1 Apr 2010 15:45
Re: Why is there no :foldupdate?
Bram Moolenaar <Bram <at> Moolenaar.net>
2010-04-01 13:45:25 GMT
2010-04-01 13:45:25 GMT
Christian Brabandt wrote:
> > sometimes I am using fold expressions to simply hide away unwanted
> > parts. Usually this boils down to
> > :set fdm=expr fde=getline(v:lnum)!~getreg('/',1)
> >
> > While this works fine, it is only limited to whatever was in register <at> /
> > when this setting was entered. Now this leaves an interesting question:
> > When are 'foldexpr' reevaluated (are they at all)? Reading :h fold.txt
> > does not mentioned when the fold expressions are reevaluated and folds
> > are updated (or I might have missed it).
> >
> > Now the obvious cure to this is to reenter the foldexpression. So if I
> > am searching for a different term, I need to enter
> > :set fde=getline(v:lnum)!~getreg('/',1)
> > and the folds will be updated.
> >
> > Of course, I could define my own :Foldupdate like this:
> > :com! Foldupdate :exe "set fde=".&fde
> >
> > But this looks so fundamental, that I am wondering, whether I am the
> > only one who is missing :foldupdate. Does anybody else think so? Or am I
> > missing something obvious?
> >
> > PS: Looking at the source, it does not seem too hard, to define an extra
> > :foldupdate command. Does that sound like a reasonable idea? I could
> > prepare a patch for this, if there is interest.
> >
> > regards,
(Continue reading)
RSS Feed