Re: Undo redux: NSTextView/NSUndoManager badly broken (really)
Re: Undo redux: NSTextView/NSUndoManager badly broken (really)
- Subject: Re: Undo redux: NSTextView/NSUndoManager badly broken (really)
- From: "David P. Henderson" <email@hidden>
- Date: Sun, 21 Oct 2001 07:50:12 -0400
On Sunday, October 21, 2001, at 05:51 , Norbert Heger wrote:
>
Yes, I've been able to isolate the problem:
>
>
- Open a new document in TextEdit
>
- Type '12'
>
- Select '1', type '3' >> the text is now: '32'
>
- Select '2', type '4' >> the text is now: '34'
>
- Perform Undo >> the text is now: '1'
>
- Perform Undo >> Raises the exception
>
In my testing, the characters used are unimportant the bug manifests
according to the sequence of the actions above and the position of the
selection / replacement relative to the end of the text and the prior
selection. To illustrate:
Case 1:
- Open a new document in TextEdit
- Type 'xyz'
- Select 'y', type '3' >> the text is now: 'x3z'
- Select 'z', type '4' >> the text is now: 'x34'
- Perform Undo >> the text is now: 'xy', should be 'x3z'
- Perform Undo >> Raises the exception
Case 2:
- Open a new document in TextEdit
- Type 'abcd efgh'
- Select 'bcd', type '123' >> the text is now: 'a123 efgh'
- Select ' ef', type ';q' >> the text is now: 'a123;qgh'
- Perform Undo >> the text is now: 'abcdgh', should be 'a123
efgh'
- Perform Undo >> Raises the exception
Case 3:
- Open a new document in TextEdit
- Type 'xyz'
- Select 'z', type '3' >> the text is now: 'xy3'
- Select 'y', type '4' >> the text is now: 'x43'
- Perform Undo >> the text is now: 'xy3'
- Perform Undo >> the text is now: 'xyz'
Case 4:
- Open a new document in TextEdit
- Type 'xyz'
- Select 'x', type '3' >> the text is now: '3yz'
- Select 'z', type '4' >> the text is now: '3y4'
- Perform Undo >> the text is now: '3yz'
- Perform Undo >> the text is now: 'xyz'
The key to the bug is:
1) Type a sequence of characters
2) Select and Replace/Delete any charaters which do not include the last
character in the sequence
3) Select and Replace/Delete any charaters adjacent to the immediate
right contiguous to the prior replacement
At this point in the Undo cycle the bug will manifest
Dave
--
Chaos Assembly Werks
"Beautiful bodies and beautiful personalities rarely go together."
- Carl Jung