1
0
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:
Cristian Maglie 2017-02-24 17:09:51 +01:00 committed by Cristian Maglie
parent f5eb673f44
commit 1f35bfca53
2 changed files with 17 additions and 2 deletions

View File

@ -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() {

View File

@ -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();