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

Undo should not be enabled for first setText #21

Closed
pmouawad opened this Issue Sep 26, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@pmouawad

pmouawad commented Sep 26, 2013

Hello,

I noticed another behaviour which seems strange:

  • In JMeter we just create a RSyntaxtTextArea inside a JTextScrollPane then we call setText to fill it.

Now when you use it, if you open a GUI which has for example 100 lines, if you hit CTRL +Z then everything is cleaned up. This seems very strange to me.

Is there some method to call to reset UndoManager edits ?
Is it discardAllEdits() or is there a better way ?

Thanks

@bobbylight

This comment has been minimized.

Show comment
Hide comment
@bobbylight

bobbylight Sep 26, 2013

Owner

Yes, if you initialize RSTA with text when it is first displayed, just call discardAllEdits() to reset the undo stack. We can't just ignore the first setText() call since it might be done e.g. in response to some UI event, and the user might want it to be undo-able.

Owner

bobbylight commented Sep 26, 2013

Yes, if you initialize RSTA with text when it is first displayed, just call discardAllEdits() to reset the undo stack. We can't just ignore the first setText() call since it might be done e.g. in response to some UI event, and the user might want it to be undo-able.

@bobbylight bobbylight closed this Sep 26, 2013

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