Search/Replace Strange Behavior

Mark Swindell mdswindell at charter.net
Fri Jul 15 12:34:12 EDT 2005


On Jul 14, 2005, at 10:47 PM, Jeanne A. E. DeVoto wrote:

> At 11:58 AM -0700 7/14/2005, Mark Swindell wrote:
>
>> I just had a strange behavior I wonder if anyone can explain.  I  
>> have a card with 3 fields containing many pages of narrative text.  
>> They are extensively formatted with linked text, colors, etc.  I  
>> used the search and replace to change occurrences of two spaces (I  
>> learned to type long ago on manual typewriters and can't shake the  
>> habit) to only one space.   I just typed in two spaces in the find  
>> field, and one in the replace field.  I limited the find/replace  
>> function to field text.  I pressed replace, and all formatting was  
>> lost on all three fields.  Is this a bug, or a feature?  I  
>> certainly didn't expect it.
>>
>
> It's a "nuance" or a "design flaw", depending on how charitable  
> you're feeling. The replace command treats its parameters as pure  
> text, so if you do something like
>
>   replace "foo" with "bar" in field "Stuff"
>
> you'll lose all formatting in the field. Replace seems to make a  
> copy of the target text, then do the replace operation, and then  
> swap the target text back into the field.
>
> The find/replace dialog really ought to be using htmlText, I think,  
> although then a certain amount of conniptions would be required to  
> avoid replacing text in an HTML tag

It's a pretty nasty nuance, then.  How's that?  :)

It renders the find and replace function useless for formatted text.   
And it did come as a shock, as it almost destroyed hours of work,  
because it can't be undone.  (No one had ever mentioned that I should  
back up my stacks regularly.) This seems like a pretty big thing that  
ought to be addressed by the engineering corps up in Edinborough, no?

Mark 



More information about the use-livecode mailing list