Author: dgolovin
Date: 2011-12-27 19:05:31 -0500 (Tue, 27 Dec 2011)
New Revision: 37566
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
doOperation(int) method changed to check if current operation is long only once
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2011-12-27
13:19:24 UTC (rev 37565)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2011-12-28
00:05:31 UTC (rev 37566)
@@ -663,22 +663,18 @@
}
public void doOperation(int operation) {
- if (operation == UNDO || operation == REDO
+ boolean isLongOperation = operation == UNDO
+ || operation == REDO
|| operation == FORMAT_DOCUMENT
- || operation == FORMAT_ACTIVE_ELEMENTS) {
- if (editor.getVPEController() != null) {
+ || operation == FORMAT_ACTIVE_ELEMENTS;
+ if (isLongOperation && editor.getVPEController() != null) {
editor.getVPEController().preLongOperation();
- }
}
try {
super.doOperation(operation);
} finally {
- if (operation == UNDO || operation == REDO
- || operation == FORMAT_DOCUMENT
- || operation == FORMAT_ACTIVE_ELEMENTS) {
- if (editor.getVPEController() != null) {
+ if (isLongOperation && editor.getVPEController() != null) {
editor.getVPEController().postLongOperation();
- }
}
}
}