mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Fixed regression tests on Indent/Unindent and Comment/Uncomment actions
RSTA for some reason doesn't fire update signals on DocumentListeners.
This commit is contained in:
parent
f5eb673f44
commit
1f35bfca53
@ -518,7 +518,8 @@ public class EditorTab extends JPanel implements SketchFile.TextStorage {
|
||||
void handleCommentUncomment() {
|
||||
Action action = textarea.getActionMap().get(RSyntaxTextAreaEditorKit.rstaToggleCommentAction);
|
||||
action.actionPerformed(null);
|
||||
|
||||
// XXX: RSyntaxDocument doesn't fire DocumentListener events, it should be fixed in RSyntaxTextArea?
|
||||
editor.updateUndoRedoState();
|
||||
}
|
||||
|
||||
void handleDiscourseCopy() {
|
||||
@ -538,6 +539,8 @@ public class EditorTab extends JPanel implements SketchFile.TextStorage {
|
||||
Action action = textarea.getActionMap().get(RSyntaxTextAreaEditorKit.rstaDecreaseIndentAction);
|
||||
action.actionPerformed(null);
|
||||
}
|
||||
// XXX: RSyntaxDocument doesn't fire DocumentListener events, it should be fixed in RSyntaxTextArea?
|
||||
editor.updateUndoRedoState();
|
||||
}
|
||||
|
||||
void handleUndo() {
|
||||
|
@ -53,12 +53,24 @@ public class BlockCommentGeneratesOneUndoActionTest extends AbstractGUITest {
|
||||
jEditTextArea.selectAll();
|
||||
|
||||
GuiActionRunner.execute(new GuiQuery<Frame>() {
|
||||
|
||||
protected Frame executeInEDT() {
|
||||
window.getEditor().getCurrentTab().handleCommentUncomment();
|
||||
return window.getEditor();
|
||||
}
|
||||
});
|
||||
|
||||
menuEditUndo.requireEnabled();
|
||||
menuEditUndo.click();
|
||||
|
||||
assertEquals(previousText, jEditTextArea.getText());
|
||||
|
||||
menuEditUndo.requireDisabled();
|
||||
|
||||
GuiActionRunner.execute(new GuiQuery<Frame>() {
|
||||
protected Frame executeInEDT() {
|
||||
window.getEditor().getCurrentTab().handleIndentOutdent(true);
|
||||
return window.getEditor();
|
||||
}
|
||||
});
|
||||
|
||||
menuEditUndo.requireEnabled();
|
||||
|
Loading…
Reference in New Issue
Block a user