Closed priand closed 1 year ago
This should be fixed in a more robust way, but fixing this in the simplest way possible for now. The actual issue is how how RTextArea
and RSyntaxTextArea
instances share the actions displayed in their context menus, which means if you mix both components in an application, they'll both get the RSTA actions.
Thank you!
Description A class cast exception happens when a user cut/copy the text contains in a
RTextArea
(-> not the syntax text one):It happens in this statement:
((RSyntaxTextArea)textArea).copyAsStyledText(theme);
When I look at the editor kit assigned to the RTextArea, it is of class
org.fife.ui.rtextarea.RTextAreaEditorKit
, so I'm not sure how it delegates toRSyntaxTextAreaEditorKit
Steps to Reproduce Create an application with both a RTextArea and a RSyntaxTextArea. In the former, display the popup menu and select 'copy' or 'cut'
Expected behavior Test should be properly copied
Actual behavior Text is not copied and an exception is thrown
Java version 17