Unfold Found Lines on "Find All"
Brought to you by:
drpython
A feature I got used to decades ago (in ISPF/PDF)...
Collapse all lines then do a "Find All" on some string.
This would Pop-Out those lines. There was an option
for how many lines to each side of the found line to
un-hide.
Then you could work on (and only have to see) the
little bits of code necessary to make changes, all at
once and generally on one screen.
Logged In: YES
user_id=796750
Do you just want me to chnage it so that lines are unfoled
by each find operation?
Logged In: YES
user_id=347890
Yeah, that's a start.
That, and if a "find all" could be implemented:
Hold current location.
Go to top of file.
Repetitively find requested string until end-of-file,
unfolding if necessary.
Options to set in preference:
After "Find All":
[Return to previous location after "Find All"]
[Got to last occurance after "Find All"]
[Got to first occurance after "Find All"]
Or is this better handled in a script?
-----------------
I'm willing to take a stab at it either way, or both, and see.
-----------------
Maybe I'll try my hand at a hide/unhide version (just to
see) instead of structure folding/unfolding. (hide/unhide
regardless of structure) Hmmm.
Logged In: YES
user_id=796750
I am a little bit confused as to the function of "Find All".
Do you want a feature to count specific matches?
Do you want an "Find and UnFold" feature?
This could be done in a DrScript (anything can),
but might be a nice feature for folks who use folding.
Logged In: YES
user_id=347890
No, not count them just find (and un-fold/un-hide) all at
once instead of having to hit the F3 key over and over again
(and bounce through the file).
If the lines were merely hid instead of structure-folded
then you'd get all the occurances of "ftitle" for instance
popped back into view with maybe 3 surrounding lines each
side (depending on preferences set) for context.
You don't always want to unfold an entire structure just to
deal with a couple of lines especially if the line(s) in
question are buried 4 levels deep (or more).
Being able to see all the uses of something specific, and
only what you need to see helps when dealing with larger
projects. (The less you have to visualize, the less you have
to maintain brain stack-space for when implementing new
features and patches.) And if you can see everything
relevant all at once it makes it much easier to work with.
Logged In: YES
user_id=796750
Hmmmm, so:
Find All finds all instances of x,
then hides every line except the lines which
contain x.
Selecting Find All again returns the view to whatever
it was previously.
Sound good?
Logged In: YES
user_id=347890
Actually you'd want to separate the hiding from the finding.
That way you could find something and then while working on
it "Find All" of something else related if necessary. (For
example: the function name of the of the code in which
you're working so you could augment all the instances of
that function call.)
Logged In: YES
user_id=796750
Well, I am currently remaking the interface, so
it would be easy to have a new section of the window
(a pane or sash) appear, with all of the matching lines.
Now we could do this one of several ways.
My preferences is to set it up so that when you double click
any of the matches, you are taken to that line in the document.
You could also allow the user to double click a match to
edit it, and editing that match edits the coresponding line
in the document.
Since the Find All results would be in a seperate panel, you
could continue working on a differenct section of the document.
Plus, the Find All results would be disconnected from the
Find mechanisms, so you could use Find, Find Next, etc, to
search for something completely different.
Logged In: YES
user_id=796750
This would also have the benefit of displaying lines
regardless of their folding state. On second thought,
perhaps the second option would be best.
Logged In: YES
user_id=796750
As of 3.0.0 (which will be out soon):
I made a plugin that does find all,
and puts the results in a pane on the left or right (your
preference).
I also fixed the folding bug. Find now makes sure the target
line is not folded. (Updated in cvs, will be in next release:
3.0.0).