On Sep 09, 2015, at 20:10, Michelle <[email protected]> wrote:
> I frequently use long GREPs as part of doing bulk search-and-replace commands
> in thousands of files at once. BBEdit performs an incredibly frustrating and
> inconvenient action every time I click anywhere outside of the search box:
> it automatically scrolls/jumps back to the top of the search field.
______________________________________________________________________
Hey Michelle,
On my OSX 10.10.5 system BBEdit 11.1.3 (3753) does not jump to the top of Find
field of the Find window. It does select the entire contents of the Find
field, and that of course creates the same issue you're complaining about — the
loss of the user's place.
I don't usually work with humongous patterns repeatedly in the Find window, so
I haven't really had a reason to notice this problem — but after testing it I
completely get where you're coming from.
As far as I know there are no preferences to control this behavior.
What I tend to do when working on a long, complex pattern is to edit it in a
regular BBEdit document and then copy and paste into the Find window.
This can be facilitated significantly by using a little AppleScript.
Script 1
-------------------------------------------------------------------
# Open the Find/Replace Pattern Document
# or bring it to the front if already open.
-------------------------------------------------------------------
set findPatFile to alias ((path to desktop as text) & "Find-Pattern.txt")
tell application "BBEdit"
try
set findPatWin to window "find-pattern.txt"
on error
open findPatFile
set findPatWin to window "find-pattern.txt"
end try
set index of findPatWin to 1
end tell
-------------------------------------------------------------------
Script 2
-------------------------------------------------------------------
# Copy Find & Replace patterns from the Find/Replace Pattern Document
# into the Find window.
# Send the Find/Replace Pattern Document to the back.
-------------------------------------------------------------------
set findPatFile to alias ((path to desktop as text) & "Find-Pattern.txt")
tell application "BBEdit"
try
set findPatWin to window "find-pattern.txt"
on error
open findPatFile
set findPatWin to window "find-pattern.txt"
end try
tell findPatWin
try
set findPattern to contents of first line whose contents is not ""
on error
set findPattern to missing value
end try
try
set replacePattern to contents of second line whose contents is not ""
on error
set replacePattern to missing value
end try
end tell
set index of findPatWin to (count of windows)
open find window
tell find window
if findPattern ≠ missing value then set text 1 to findPattern
if replacePattern ≠ missing value then set text 2 to replacePattern
end tell
end tell
-------------------------------------------------------------------
The script will tolerate a single pattern in the Find/Replace Pattern Document
and treat it as the find-pattern.
If there is a second pattern it will be treated as the replace-pattern.
Any lines after the second non-blank line will be ignored, so you can have as
many inactive patterns as you want.
This is not as convenient as having the Find window work the way you want it
to, but it does give you some options and is highly customizable as you can see.
I suggest you make your case clearly in a feature request to Bare Bones
Software <[email protected] <mailto:[email protected]>>.
--
Best Regards,
Chris
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].