Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not be able to undo initial document text #25

Closed
GoogleCodeExporter opened this issue May 5, 2015 · 4 comments
Closed

Should not be able to undo initial document text #25

GoogleCodeExporter opened this issue May 5, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. launch SyntaxTester
2. press ctrl-z

What is the expected output? What do you see instead?

Expected: no action, the original text is the initial state to the user
Actual: the editor becomes empty, which is the initial state to the code

I think SyntaxDocument/SyntaxKit should call
CompoundUndoManager.discardAllEdits() at the right time, or there needs to
be a public method in SyntaxDocument so the client can clear edits when
they choose.

Original issue reported on code.google.com by javlo...@gmail.com on 14 Aug 2008 at 3:07

@GoogleCodeExporter
Copy link
Author

I like the second approach.  I also think when you call the setText on a 
control, all
undos should be discarded.

Original comment by ayman.al...@gmail.com on 14 Aug 2008 at 5:53

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

I like the second approach.  I also think when you call the setText on a 
control, all
undos should be discarded.

Original comment by ayman.al...@gmail.com on 14 Aug 2008 at 5:55

@GoogleCodeExporter
Copy link
Author

The problem is that the setText on the control gets translated to a remove 
followed
by insert on the document.  At that level, I have no way of knowing if that was 
a
setText at either method.  It will be bug prone if a state is maintained 
between the
two methods just to see if a setText was called.
For that, I added a method to the Document to discard all undo.  This will be 
withe
other changes I'm working on right now.   

Original comment by ayman.al...@gmail.com on 17 Aug 2008 at 6:58

@GoogleCodeExporter
Copy link
Author

clearUndos method added to SyntaxDocument.

Original comment by ayman.al...@gmail.com on 28 Sep 2008 at 9:28

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant