I wrote a vim script that reproduces case 2 of Evan's original bug
report; it is available at this gist: http://gist.github.com/427303

The idea is to run $(vim -u indent_fold_bug.vim) to bring up an
exemplary mis-fold in the top window and to put in the bottom window a
display of foldlevel() for each line in the buffer for each of the few
operations needed to bring about that improper fold state.  Not super
amazing, but it could make things a bit more convenient.

Not sure if this is of any value to people, I mostly just did it to
help narrow down a bit the conditions for this bug.  But since I've
already posted it online, I thought I would make it known to this
list, in case it could be useful to people working on this bug.  I'm
assuming from the fact that no further replies have been made on this
thread that the bug is still open?  Sorry, I'm unfamiliar with the
protocol here; also used to using bug trackers more so than mailing
lists.  Also it appears that patch 7.2.421 is a workaround for this
issue, but maybe there are other problems with folding that it
addresses.  Anyway sorry if I missed a fix for this in a scan of the
recent patches.

The analysis output uses the v:key() variable within a map() call on a
List, so that output will only work with versions of vim >= 7.2.295.
Sorry about that, when I wrote the script I was unaware that this is a
relatively new feature of that function (it doesn't seem to be
documented as such in `eval.txt`, at least not as of 7.2.330).  I
originally wrote the script on a machine with patches up to 7.2.330; I
just tried it on another with patches only up to 7.2.245 and
discovered that the bug is identically reproduced.  These are both
ubuntu versions of the "Huge" vim-gnome package; one is for 10.04 and
the other 9.10.

Anyway, if somebody wants to run the script to test patches on earlier
versions of vim for some reason, let me know and I'll patch the gist,
or you can fork it, or whatever.

I'm also a bit confused at the lack of a "reply to list" option when
viewing the archives; maybe I'm missing a setting or something?

Cheers
-Ted


---------- Forwarded message ----------
From: Evan Laforge <qdun...@gmail.com>
Date: Oct 28 2009, 4:22 pm
Subject: foldmethod=indent bugs?
To: vim_dev


>> 4. foldmethod=all seems buggy.  When I turn it on, folds open even
>> when I move through them vertically, and neverfoldeven when I try to
>> close them explicitly.  Setting all the documented foldopen values
>> doesn't have this affect, so evidently 'all' is not the same as
>> including everything manually.

> You mean ":set foldopen=all".  Right, "all" is not the same as adding
> all the other ones.  That works as intended, afoldat the cursor is
> always open.

Ah, I see, I misunderstood the documentation.  Would it make sense to
add a 'put' option?  Or are puts intended to unfold and the current
behaviour is due to a bug?

> Looks like another instance of the first problem.

Indeed, I hope so, then they can both be fixed at once :)

The interesting one is the one only triggered by having a nested
openfoldinside.

When I get some time I'll see if these happen with the otherfold
methods, and maybe take a look atfold.c if it's not too scary.

-- 
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

Raspunde prin e-mail lui