> I want to open a (vb.net) file with a special range (/^#Region/,/^#End
> Region/) being folded.
> If this range does not exist, I don't want to get an error message.
Well, you can have at startup (not sure whether you'd like this
in a custom ftplugin, or just a hack in your vimrc, or what-not)
a solution I use regularly. However, it has to meet a couple
1) your "#region ... #end region" can't be nested, so the
following wouldn't work
2) if you have a #start, you have to have an #end. It works if
you don't have *both*, but if you have the start, it should be
closed, or otherwise funky stuff happens.
So the solution I use regularly:
If there are no starting regions, the search for the end of the
fold will never get requested, and thus prevent errors.
Hope this helps,