mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-27 21:54:30 +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() {
|
void handleCommentUncomment() {
|
||||||
Action action = textarea.getActionMap().get(RSyntaxTextAreaEditorKit.rstaToggleCommentAction);
|
Action action = textarea.getActionMap().get(RSyntaxTextAreaEditorKit.rstaToggleCommentAction);
|
||||||
action.actionPerformed(null);
|
action.actionPerformed(null);
|
||||||
|
// XXX: RSyntaxDocument doesn't fire DocumentListener events, it should be fixed in RSyntaxTextArea?
|
||||||
|
editor.updateUndoRedoState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDiscourseCopy() {
|
void handleDiscourseCopy() {
|
||||||
@ -538,6 +539,8 @@ public class EditorTab extends JPanel implements SketchFile.TextStorage {
|
|||||||
Action action = textarea.getActionMap().get(RSyntaxTextAreaEditorKit.rstaDecreaseIndentAction);
|
Action action = textarea.getActionMap().get(RSyntaxTextAreaEditorKit.rstaDecreaseIndentAction);
|
||||||
action.actionPerformed(null);
|
action.actionPerformed(null);
|
||||||
}
|
}
|
||||||
|
// XXX: RSyntaxDocument doesn't fire DocumentListener events, it should be fixed in RSyntaxTextArea?
|
||||||
|
editor.updateUndoRedoState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleUndo() {
|
void handleUndo() {
|
||||||
|
@ -53,12 +53,24 @@ public class BlockCommentGeneratesOneUndoActionTest extends AbstractGUITest {
|
|||||||
jEditTextArea.selectAll();
|
jEditTextArea.selectAll();
|
||||||
|
|
||||||
GuiActionRunner.execute(new GuiQuery<Frame>() {
|
GuiActionRunner.execute(new GuiQuery<Frame>() {
|
||||||
|
|
||||||
protected Frame executeInEDT() {
|
protected Frame executeInEDT() {
|
||||||
window.getEditor().getCurrentTab().handleCommentUncomment();
|
window.getEditor().getCurrentTab().handleCommentUncomment();
|
||||||
return window.getEditor();
|
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();
|
menuEditUndo.requireEnabled();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user