-
1. Re: changeGrep alters selection
P Spier Apr 6, 2013 2:46 AM (in response to RobertKyle)I don't think I'm seeing what you see, or I don't understand the description. My selections still cover the same selections, less any deleted spaces using your query (provided I do a Change All), but you might want to try Find: (?<=\x{0020})\x{0020}+ and Change: "" instead. (That's null, or blank)
-
2. Re: changeGrep alters selection
RobertKyle Apr 8, 2013 2:41 PM (in response to P Spier)Thanks, Peter. I'm not getting the same result today, either. Maybe this was just one of those Adobe-needs-a-restart issue. That's a good tip about {0020}. I've confused myself with " " or " "
-
3. Re: changeGrep alters selection
P Spier Apr 8, 2013 3:10 PM (in response to RobertKyle)You need the \x in front of it to tell ID it's lookinf for a hex code, though...
-
4. Re: changeGrep alters selection
RobertKyle Apr 25, 2013 6:29 PM (in response to RobertKyle)I can now reproduce this pretty reliably.
Start with a block of text containing more than one set of multiple spacebands. This poorly typed paragraph will do nicely. If you look closely you'll see that there are extra spaces between each word.
Select all text in the frame. Then use this grep search on the selection, changing to nothing:
(?<=\x{0020})\x{0020}+
The result I get is that all the extra spaces are stripped out but the selection has shortened so that the whole story is no longer selected. As I said, I'm using this grep search in a script, so the next steps of the script sometimes fail because of the change in the amount of selected text. But the problem occurs in the nonscripted interface as well.
It doesn't seem to happen if the original selection is something less than the whole story. So it's some combination of selecting whole story and then searching the selection. I think there also has to be more than one "hit" in the selection.
My immediate idea is to simply run this search on the entire story, regardless of what the user has actually selected. Can't imagine that being a problem unless someone wants to publish examples of bad typing. Still, it's curious.
-
5. Re: changeGrep alters selection
P Spier Apr 26, 2013 7:20 AM (in response to RobertKyle)It happens in your sample text here, too, now, but so far ONLY when the selection includes the last character of the last paragraph of the story that conatins text. It happens even if there are empty paragrapgs following.
Not sure if that's helpful, but I think it probably means there's some sort of bug at work.
-
6. Re: changeGrep alters selection
Eugene Tyson Apr 26, 2013 7:51 AM (in response to RobertKyle)have you tried +?
-
7. Re: changeGrep alters selection
Eugene Tyson Apr 26, 2013 7:52 AM (in response to Eugene Tyson)that should be [space][space]+?
-
8. Re: changeGrep alters selection
RobertKyle Apr 26, 2013 3:07 PM (in response to Eugene Tyson)Yes, that's actually how this discussion started. Peter suggested \x{0020} which made sense to me because its more readable than " ". But the problem seems to be the same.
My first idea for a workaround was a flop. Even when the search targets the whole story, the selection shortens up if it includes the last character of the last paragraph. So now I'm thinking that I have to check to see if the last character of the selected text is the same as last character of the parentStory. If so, I'll restore the selection after the extra spaces have been wrung out.
-
9. Re: changeGrep alters selection
RobertKyle Apr 26, 2013 3:43 PM (in response to RobertKyle)Also, the effect is not limited to searching for spaces. Try searching for "h." and replacing with "h". And it's not just grep searches, either. Same thing happens with ordinary find/change.
The key elements seem to be: 1) The selection includes the last character of the last paragraph and 2) the Find/change reduces the length of the selected text.




