stuie382 / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Should not be able to undo initial document text #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago
clearUndos method added to SyntaxDocument.

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