|
From: Mike M. <ma...@um...> - 2009-08-22 19:54:06
|
This started out as an email asking whether there was a way to do
something (collapse all elements with a given tag in an XML file), then
turned into an email asking about the speed of computing folds. But
they're related.
I'm editing a long XML file. I want to collapse all the XML elements
with a given tag. I do not in general want to collapse other XML
elements which might happen to be at the same depth of nesting, and not
all the elements with the given tag will necessarily be at the same
level of embedding.
Is there a way to do this? I have the XML and Sidekick plugins
installed, but I don't see any such command there, nor in the macros
menu. But maybe I'm just not looking in the right place.
I just now tried the Configurable Fold Handler plugin. In place of the
XML mode-specific default fold patterns, I gave it the open/close tags
for one of the elements I want to collapse (figuring if that worked, I
would think about how to do it for all the tags whose elements I want to
collapse). Then I told jEdit to "collapse all folds". It hung, or at
least becomes extremely sluggish. Granted, there are around 5000 such
elements in the file, but it didn't seem like it would be *that* bad...
It appears from further experimentation that this hanging problem is not
so much a problem with the Fold Handler plugin, as it is with having
lots of folds marked. For example, if I remove this plugin and just
mark the folds with the Sidekick plugin, then drag the elevator down
about a fourth of the way through the file, jEdit appears to hang for
awhile. Once it un-hangs, I can drag the elevator up and down in the
first fourth of the file and the display zooms, but if I try to drag it
past the lowest point where I had dragged it before, it again hangs for
awhile. And of course turning off the Folding Mode entirely means I can
scroll through the file at high speed. So my guess is that jEdit only
computes the folds up to the maximum position in the file that I've gone
to; and if I tell it to collapse all the folds, it hangs trying to
compute them all. Could it instead do the fold computation in a
background thread after the file is loaded?
This is with jEdit 4.3pre18, downloaded several weeks ago (16 July, I
believe). The file I'm trying to fold has just over 100k lines, about 2
megs; I have the command line set to increase the Java heap size:
C:\Windows\SysWOW64\javaw.exe -Xms256M -Xmx768M -jar "C:\Program Files
(x86)\jEdit 4.3pre18\jedit.jar"
--
Mike Maxwell
What good is a universe without somebody around to look at it?
--Robert Dicke, Princeton physicist
|